News for hackers. Stuff that matters.
Re:How JavaScript Works: deep dive into call, apply, and bind by hajile on Friday July 09, 2021 @06:36PM (#27789287)
That creates an entire extra list of garbage.
Re:How JavaScript Works: deep dive into call, apply, and bind by lhorie on Friday July 09, 2021 @07:28PM (#27789635)

    const 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...
Re:How JavaScript Works: deep dive into call, apply, and bind by chrisseaton on Friday July 09, 2021 @06:42PM (#27789337)
Doesn’t the compiler optimise it away?
Re:How JavaScript Works: deep dive into call, apply, and bind by hajile on Friday July 09, 2021 @06:57PM (#27789470)
Those 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.