charCodeAt-2

 

charCodeAt-2

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <button onclick="findUnicode()">Display the unicode</button> <p id="sample"></p> <script> function findUnicode() { var str = "HELLO WORLD"; var n = str.charCodeAt(str.length-1); document.getElementById("sample").innerHTML = n; } </script> </body> </html>
Output