$ coffee > '1'+2 '12' > '1'-2 -1 > 1 < null false > 1 > null true > 1 < undefined false > 1 > undefined false > a = [1,2,3] [ 1, 2, 3 ] > a.b = 4 4 > (x for x in a) [ 1, 2, 3 ] > (x for x of a) [ '0', '1', '2', 'b' ] > (x for x in 'abc') [ 'a', 'b', 'c' ] > (x for x of 'abc') [ '0', '1', '2' ] >
It makes sense once you know it … but that’s the whole thing with being a newbie, eh?
That array-with-poperties behaviour is actually very useful, because it lets you create collections which can be looped over, while still offering members in an object-like manner. Very Lua-ish. The same can be done with Object.defineProperty, but that’s more involved.