wiki/content/20201112102537-javascript_string_to_array_conversion.md

19 lines
391 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-29 18:27:12 +00:00
date: 2020-11-12
2024-05-06 20:40:05 +00:00
id: 0efc7236-a6cb-402f-91f6-f05f038a4aa2
title: JavaScript String To Array Conversion
---
# Description
Strings can be [converted](20200613170756-javascript_type_conversion)
into [arrays](20200826201029-arrays) with the
[spread](20201014094144-spread) operator:
# Syntax
``` javascript
const chars = [..."abc"];
console.log(chars); // Array(3) [ "a", "b", "c" ]
```