Animations
API
Arrays
Async
Basics
Challenges
Classes
Console
Dates
Debugging
DOM Elements
DOM Methods
DOM Properties
Event Listeners
Flow Control
Forms
Functions
Global Functions
JSON
Keywords
Libraries (3rd party)
Math
Modules
Objects
Snippets
String
Types
Widgets
Window Object
The charAt()
method returns the character at a specified index (position) in a string.
The charCodeAt()
method returns the unicode of the character at a specified index in a string.
let str = "HELLO WORLD";
str = str.charAt(0);
document.getElementById("demo1").innerHTML = str;
let str2 = "HELLO WORLD";
str2 = str2.charCodeAt(0);
document.getElementById("demo2").innerHTML = str2;