Hacker News new | past | comments | ask | show | jobs | submit login

I taught javascript to an older person once, and I think for-loops are one of those things that people who studied programming think "are not so bad", but it's absolutely senseless and insane to outsiders.

I'm thinking

    var output = [];
    for (var i=0; i<listOfThings.length; i++) {
        var thing = listOfThings[i];
        var newThing = applyAction(thing);
        output.push(newThing);
    }
vs.

    listOfThings.map(thing => applyAction(thing));
and even that is a little bit iffy.



Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: