Online HTML Editor
Javascript Online Compiler
index.html
Change Theme
Compress code
Uncompress code
Download Code
Clear Code
Copy Code!
RunĀ
Click to run or ctrl+s
Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Javascript - String charcodeat</title> </head> <body> <h2>charCodeAt method return unicode value of the character present at given index of the string.</h2> <script> const str = "Brenden Eich"; console.log(str.charCodeAt()); //default index value = 0 console.log(str.charCodeAt("x")); //default index value = 0 console.log(str.charCodeAt(1)); console.log(str.charCodeAt(13)); // return NaN </script> </body> </html>
RunĀ