Translate

Total Pageviews

charCodeAt()

 

JavaScript String charCodeAt()

The charCodeAt() the method returns the Unicode of the character at a specified index in a string:

The method returns a UTF-16 code (an integer between 0 and 65535).

---------

<!DOCTYPE html>

<html>

<body>


<h2>JavaScript String Methods</h2>


<p>The charCodeAt() method returns the unicode of the character at a given position in a string:</p>


<p id="demo"></p>

<script>

let text = "HELLO WORLD";

document.getElementById("demo").innerHTML = text.charCodeAt(0);

</script>


</body>

</html>

------------------------------------------

Result:

JavaScript String Methods

The charCodeAt() method returns the Unicode of the character at a given position in a string:

72

No comments:

Post a Comment

Add your comment here.