3 ms·
That creates an entire extra list of garbage.
by hajile 5y ago
That creates an entire extra list of garbage.
- chrisseaton 5y agoDoesn’t the compiler optimise it away?
- hajile 5y agoThose aren't the same types. One is a DOM array and the other is a JS array. They don't share the same constructor or the same prototype chain.
- lhorie 5y agoconst mapNodeList = (...nodeList) => nodeList.map(myFn); mapNodeList(...$nodeList) Garbage collection really isn't the biggest of concerns here considering this code is susceptible to a stack overflow...