✒️
Here are my favorite tips to land the software engineer interview.
Here are my favorite tips to land the software engineer interview.
How to Convert String to Array of Characters in JavaScript
Published Aug 24, 2020
∙ Updated May 2, 2022
ES6 (ES2015) introduced the spread operator ...
, which essentially dumps the contents of an array, object, and even string.
We can declare an array and use the spread operator to dump each character of the string into the array.
const dog = 'corgi'
const converted = [ ...dog ] // ['c', 'o', 'r', 'g', 'i']