How to get first character of String in Javascript

Use s.charAt(0)

Example:

const s = "banana";
const firstChar = s.charAt(0); // == 'b'
// This will print 'b'
console.log(firstChar);