Files
30-seconds-of-code/snippets/to-char-array.md
Angelos Chalaris 61200d90c4 Kebab file names
2023-04-27 21:58:35 +03:00

392 B

title, tags, cover, firstSeen, lastUpdated
title tags cover firstSeen lastUpdated
String to character array string waving-over-lake 2020-10-08T15:17:22+03:00 2020-10-08T15:17:22+03:00

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']