Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 287 Bytes

toCharArray.md

File metadata and controls

16 lines (12 loc) · 287 Bytes
title tags
toCharArray
string,beginner

Converts a string to an array of characters.

  • Use the spread operator (...) to convert the string into an array of characters.
const toCharArray = s => [...s];
toCharArray('hello'); // ['h', 'e', 'l', 'l', 'o']