News for hackers. Stuff that matters.
Re:How it feels to learn JavaScript in 2017 by polymeris on Monday August 28, 2017 @10:54PM (#15121789)
> it's impossible to go back.

I too, am learning JS in 2017, and I can't wait to go back (to cljs). Or away, to anything else. I had done some basic stuff before, but for the last days I have been writing some code for a larger SPA.

Just as an example, today I needed to do the simple task of iterating over a dictionary. I expected it to go roughly like this:

    dictionary.forEach(this.someMethod);
Instead, this is apparently what passes for sane in JS world, in 2017:

    for (var key in dictionary) {
        if (dictionary.hasOwnProperty(key) {
            this.someMethod(key, dictionary[key]);
        }
    }
Re:How it feels to learn JavaScript in 2017 by rattray on Wednesday August 30, 2017 @01:45AM (#15129948)
There are other options, closer to what you're looking for. Try

    Object.entries(dict).forEach(fn)
Or

    _.entries(dict).forEach(fn)