When you pass anonymous function, then every execution of that function needs to look up `String.fromCharCode` (anonymous functions save scope, not references).
I'm surprised by the benchmark as well. I suspect it may be because calls to native functions are handled differently from calls to JS functions, and JS engine is able to optimize call inside anonymous function (create trace/JIT and inline it), but not when calling by reference (and perhaps keeps calling it by some expensive proxy object).
* In the first version each time the anonymous function is executed interpreter has to lookup String and from it the fromCharCode method => 2n lookups.
* In the second version the String and fromCharCode have to be lookud up only once => 2 lookups.
Therefore according to slow-lookups-theory the first version should be slower. Except when I measure it, the opposite turns out to be true.
One would think that String.fromCharCode is looked up only once, though.