I wanted to pass an array of number to the method String.fromCharCode(), I read another thread and tried to chain apply after fromCharCode, but it doesn't work for me. Here's the code:
function rot13(str) {
var reStr = "";
var asciiCodedArr = [70,82,69,69,32,67,79,68,69,32,67,65,77,80];
reStr = String.fromCharCode().apply(null, asciiCodedArr);
return reStr;
}
rot13("SERR PBQR PNZC");
And it yells back at me:
TypeError: String.fromCharCode(...).apply is not a function
Where did I mess up ?