How to use charPointAt() function In Javascript
The charPointAt() function also returns the unicode of the string. It returns the specific Unicode number with a specific index of the string.
Example: To demonstrate printing one ASCII character from the string using the charPointAt() function in JavaScript.
Javascript
let text = "Geeks for Geeks" ; let code = text.codePointAt(1); console.log( " ASCII Number = " + code); |
ASCII Number = 101
Print ASCII Value of a Character in JavaScript
ASCII is a character encoding standard that has been a foundational element in computing for decades. It is used to define characters in a computer. There is a huge table of ASCII values. To print the values in JavaScript In this post, we print the ASCII code of a specific character. One can print the ASCII code for the specific character in JavaScript using several methods which are as follows:
Table of Content
- Using charCodeAt() function
- Using charPointAt() function
- Finding String ASCII with Array.from() method