I noticed that String.fromCharCode()
does not work with a variable as parameter.
Here is some sample code:
var x = atob('ODAsNjUsODMsODMsODcsNzksODIsNjgsOTUsNDgsNDk=');
console.log('\''+x.replace(new RegExp(',', 'g'), '\',\'')+'\'');
console.log(String.fromCharCode('\'' + x.replace(new RegExp(',', 'g'), '\',\'') + '\''));
Now this would evaluate to
'80','65','83','83','87','79','82','68','95','48','49'
which is a correct parameter chain for String.fromCharCode()
because this works:
console.log(String.fromCharCode('80','65','83','83','87','79','82','68','95','48','49'));
Why doesn't it accept the variable as parameter?
Have I done something wrong here?