Rename javascript to js

This commit is contained in:
Angelos Chalaris
2023-05-03 20:39:23 +03:00
parent d02bbb0c68
commit 7511813169
578 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,19 @@
---
title: String to character array
type: snippet
tags: [string]
cover: waving-over-lake
dateModified: 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.
```js
const toCharArray = s => [...s];
```
```js
toCharArray('hello'); // ['h', 'e', 'l', 'l', 'o']
```