3 ms·
How is .map() not a slow loop? I'm not a js Dev, but my understanding is it loops over all elements in a list, applying a function and creating a new list. With
by sethammons 8y ago
How is .map() not a slow loop? I'm not a js Dev, but my understanding is it loops over all elements in a list, applying a function and creating a new list. With a loop. That would be as fast as any other loop. What am I missing?
- lampe3 8y agoThe point is that map itself returns an new array. But people use it for just looping through an array without creating a new one