JavaScript | String.fromCodePoint()

The String.fromCodePoint() is an inbuilt function in JavaScript which is used to return a string or an element for the given sequence of code point value (ASCII value).
List of code point values of different elements:
Syntax:

String.fromCodePoint(a1, a2, a3, ....)

Parameters: Here parameter 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.

JavaScript code to show the working of String.fromCodePoint() function:

Code #1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<script>
  
    // Taking some code point values
    a = String.fromCodePoint(42);
    b = String.fromCodePoint(65, 90);
    c = String.fromCodePoint(66, 65, 102);
  
    // Printing the corresponding elements of
    // the code point value.
    document.write(a + "<br>")
    document.write(b + "<br>")
    document.write(c + "<br>")
  
</script>

chevron_right


Output:

*
AZ
BAf


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.