String.fromCharCode only works with one character

620 Views Asked by At

I have javascript code:

s = String.fromCharCode(s);

This works but it only works with one character even though the String.fromCharCode method is supposed to work with multiple characters seperated by commas. Any ideas why this is?

1

There are 1 best solutions below

0
On

If you want more than one character, you'll want to pass a sequence of values...

String.fromCharCode(65, 66, 67);  // "ABC"