JavaScript String fromCodePoint() Method
JavaScript String fromCodePoint() is an inbuilt method in JavaScript that is used to return a string or an element for the given sequence of code point values (ASCII value).
List of code point values of different elements: https://en.wikipedia.org/wiki/List_of_Unicode_characters
Syntax:
String.fromCodePoint(a1, a2, a3, ....)
Parameters: Here parameters a1, a2, etc are the sequence of code point values.
Return value: It returns the corresponding string or elements for the given sequence of code point values.
Below is an example of the String.fromCodePoint() Method.
Example 1: This example shows the basic use of the String.fromCodePoint() Method in Javascript.
javascript
let a = String.fromCodePoint(71, 70, 71);
console.log(a);
|
Example 2: This example shows the basic use of the String.fromCodePoint() Method in Javascript.
javascript
let a = String.fromCodePoint(42);
let b = String.fromCodePoint(65, 90);
let c = String.fromCodePoint(66, 65, 102);
console.log(a);
console.log(b);
console.log(c);
|
Example 3: This example shows the basic use of the String.fromCodePoint() Method in Javascript.
javascript
let a = String.fromCodePoint(71, 101, 101, 107, 115);
console.log(a);
|
We have a complete list of Javascript string methods, to check those please go through this Javascript String Complete reference article.
Supported Browser:
- Chrome 41 and above
- Edge 12 and above
- Firefox 29 and above
- Opera 28 and above
- Safari 10 and above
Last Updated :
18 Jul, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...