3 ms·
And all of it stems from the fact that, JavaScript being a dynamic language, there's no way to statically determine whether the function will use 'element' or n
by victorNicollet 15y ago
And all of it stems from the fact that, JavaScript being a dynamic language, there's no way to statically determine whether the function will use 'element' or not (it could always eval() something evil and sneaky). Most functional languages would avoid packing 'element' at compile time, and I suspect that modern JavaScript compilers also handle this optimization whenever they can afford it.