News for hackers. Stuff that matters.
Re:CIL (.NET bytecode) to WebAssembly compiler by lqdc13 on Thursday September 03, 2015 @09:38AM (#10164840)
So now we have ...

    for each (var x in a) ...  <<Firefox only??>>
    for (var x of a) ...  <<ES6>>
    for (var x in a) ...
    a.forEach(callback[, thisArg])
Knowing JS, each of them have their own quirks probably.
Re:CIL (.NET bytecode) to WebAssembly compiler by kolme on Thursday September 03, 2015 @09:46AM (#10164892)
Yes:

for each (...) -> It's not supported anywhere, so forget it.

for (var x in a) -> x is the key, so it's kind of inconvenient. You have to watch out for inherited properties/methods so one should check for a.hasOwnProperty(x).

for (var x of a) -> It has mostly no gotchas. Only poor browser support.

.forEach only works with arrays and from ES5 on. You have the good old "this"/scope gotcha.