Keerti Kotaru
Mar 2, 2021

--

Short and crisp! πŸ‘πŸΌ

Here is another way to get characters out of a string (and get the result as an array)

Object.values('this is a test')

In case we need to remove one or more spaces

Object.values('this is a test'.trim()).filter( s => s !== " ")

Result

(11)Β ["t", "h", "i", "s", "i", "s", "a", "t", "e", "s", "t"]

Nice way to have fun with JavaScript πŸ˜„

--

--