The first character in the JS string or any position.
xxxxxxxxxx
const str = 'Coding Beauty';
const firstChar = str.charAt(0);
console.log(firstChar); // C
xxxxxxxxxx
let str = 'John Wick'
let firstChar = str.charAt(0)
console.log(firstChar); // "J"
xxxxxxxxxx
const string = 'Hello';
const firstCharacter = string.charAt(0);
console.log(firstCharacter);
xxxxxxxxxx
const str = "Hello world";
const firstChar = str.charAt(0); // Retrieves the first character of the string
console.log(firstChar); // Outputs 'H'