Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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("");
 
PREVIOUS NEXT
Tagged: #javascript #character #string
ADD COMMENT
Topic
Name
7+3 =