4 ms·
Why not just have var foo = 1
by philliphaydon 7y ago
Why not just have
var foo = 1
- deleted 7y ago[deleted]
- masklinn 7y agoThat works actually. The weirdness is that ":=" allows redeclaration (within a scope) but only partial, whereas `var` completely forbids redeclaration. That is: var a, b = f() var a, b = f() // NO var a, b = f() a, b := f() // NO // note that the second declaration only partially overlaps with the first var a, b = f() var a, c = f() // NO var a, b = f() a, c := f() // yes