
Use the spread operator (...
) to convert the string into an array of characters.
const toCharArray = s => [...s];
// EXAMPLE
toCharArray('hello'); // ['h', 'e', 'l', 'l', 'o']
Source
https://www.30secondsofcode.org/js/s/to-char-array