News for hackers. Stuff that matters.
Re:Using const/let instead of var can make JavaScript code r... by twsted on Wednesday October 21, 2020 @02:58AM (#24845386)
But

   arr.foreach(elem => { ... });
is still always much slower than a for loop, having the callback call, isn't it?
Re:Using const/let instead of var can make JavaScript code r... by DougBTX on Wednesday October 21, 2020 @06:45AM (#24846504)
That very much depends on how good the JIT is, certainly many AOT compilers would understand this pattern and inline the callback, resulting in very similar optimised code.