JavaScript String charCodeAt() method

The JavaScript string charCodeAt() method retrieves the Unicode value of a character present at the specified index. Index can be from 0 to n-1 where n is the size of the string. It will return an integer value between 0 and 65535.

Syntax:

string.charCodeAt(index) 

Parameters:
index: It represents the specified position of a character.

Return:
It will return an integer value between 0 and 65535 i.e. Unicode value of a character.

Example:

<!DOCTYPE html>
<html>
<body>
<script>
var hello ="HELLO WORLD!";
document.writeln(hello.charCodeAt(11));
</script>
</body>
</html>