4 ms·
Good article, but I wanted to point out that the looping and comprehensions stuff isn’t really much different with ES5’s array methods. The first example can a
by blakehaswell 13y ago
Good article, but I wanted to point out that the looping and comprehensions stuff isn’t really much different with ES5’s array methods.
The first example can actually be written as the much more readable:
myArray.forEach(function (item) {
// do something with item
});
While the second example can be written as:
var myNewArray = myArray.map(modify);
- deleted 13y ago[deleted]