Weird output of [97,98].map(String.fromCharCode)
问题 this works as expected [97,98].map(function(x){String.fromCharCode(x)}) // [ 'a', 'b' ] but the output is following line is unexpected [97,98].map(String.fromCharCode) // [ 'a\u0000\u0000', 'b\u0001\u0000' ] 回答1: String.fromCharCode can accept a variable length of arguments, and treats each one as a character code to build a string arguments.length characters long. map passes several arguments to the inner function. The first, obviously, is the value of the current item. The second is the