const string = 'hi there';
const usingSplit = string.split('');
const usingSpread = [...string];
const usingArrayFrom = Array.from(string);
const usingObjectAssign = Object.assign([], string);
// Result
// [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e' ]
var word = userInput[0];
var l = word.split("");
console.log(l);
//input abb
//op ['a','b','b']
// V1
const word = "abcd";
const characterArray = word.split(""); // ["a", "b", "c", "d"]
// V2
[...word] // ["a", "b", "c", "d"]
let input = "words".split("");
let output = [];
input.forEach(letter => {
output.push(letter.charCodeAt(0))
});
console.log(output) //[119, 111, 114, 100, 115]
[..."text"].map(letter=>letter.charCodeAt(0))