Javascript String charCodeAt() Example | String.Prototype.CharCodeAt()

Javascript string charCodeAt() is an inbuilt function that returns the Unicode of the first character in a string. The charCodeAt() method returns the Unicode of the character at the specified index in the string. An index of the first character is 0, the second character 1, and so on.

Javascript String charCodeAt() Example

The syntax of String charCodeAt() function is following.

string.charCodeAt(index)

The index parameter is required, and a number representing the index of the character you want to return.

The charCodeAt method returns β€œNaN” if there is no character at the specified index, or if the index is less than β€œ0”.

#javascript #javascript string charcodeat() #js

Javascript String charCodeAt() Example | String.Prototype.CharCodeAt()