JavaScript Code

JavaScript String fromCharCode()


String fromCharCode()

String.fromCharCode(n1)
String.fromCharCode(n1, n2)
String.fromCharCode(n1, n2, .., nN)
  • String is the string class
  • fromCharCode is function name
  • n1, n2, .., nN are Unicode values

fromCharCode() method takes one or more Unicode values n1, n2, .., nN as arguments, are returns a string value

Examples

1. convert Unicode value to string

const n1 = 65;
const output = String.fromCharCode(n1);
console.log(output);

2. convert multiple Unicode values to string

const output = String.fromCharCode(65, 80, 80, 76, 69);
console.log(output);


Copyright @2022