I simply can't understand why the second and the third lines of output differs one from another:
alphabet_ASCII = '';
for (i=65; i<=90; i++) {
alphabet_ASCII += i;
}
alphabet_ASCII += '<br>';
document.body.innerHTML += alphabet_ASCII;
document.body.innerHTML +=
alphabet_ASCII.replace(/\d{2}/g, x=>String.fromCharCode(x));
document.body.innerHTML +=
alphabet_ASCII.replace(/\d{2}/g, String.fromCharCode);
What's the difference between x=>String.fromCharCode(x)
and String.fromCharCode
?