take character from string javascript code example
Example 1: javascript get character from string
// (ES6 / ES2015)+ way of doing it
const str = "Hello World!";
const chars = [...str];
// Pre-ES2015 way of doing it
var chars2 = str.split("");
Example 2: javascript string return character
var str = "HELLO WORLD";
var res = str.charAt(0);