News for hackers. Stuff that matters.
Re:EcmaScript Sixth Edition by VeejayRampay on Thursday July 03, 2014 @04:56AM (#7982122)
Unless I'm missing something, you cannot use forEach on a Javascript object as of now (or map, reduce, every, some and other methods that are available on Array.prototype).

The only way is to use:

  for(var key in obj) {...}
As for interpolation, I indeed missed the bit about quasis. Though I really wonder why they would still use concatenation if they can interpolate... Maybe to only show one feature at a time, which I guess makes sense.
Re:EcmaScript Sixth Edition by arcosdev on Thursday July 03, 2014 @05:48AM (#7982220)
You are correct, there is no forEach, a lot of libraries implement their own, but no native version.
Re:EcmaScript Sixth Edition by SimeVidas on Thursday July 03, 2014 @08:07AM (#7982563)

    Object.keys(obj).forEach(function (key) {
        var val = obj[key];
        
        // use key and val here
    });
Re:EcmaScript Sixth Edition by omaranto on Thursday July 03, 2014 @09:24AM (#7982895)
I think you did miss something: the comment you replied to didn't say

    x.forEach(f);
but rather

    items(x).forEach(x);
which is definitely possible, you just need to implement items().