If using ES6, use template litorals

Probably being pernickety.  But if we're using ES6, you could just use a template litoral instead of string concat? Not sure if the litoral version is a bit more difficult to read mind you.
This commit is contained in:
Les
2018-01-05 11:38:34 +00:00
committed by GitHub
parent 800978d152
commit 74ae6b7f77

View File

@ -6,7 +6,7 @@ Convert the number to a string, using spread operators in ES6(`[...string]`) bui
Use `Array.map()` and `parseInt()` to transform each value to an integer. Use `Array.map()` and `parseInt()` to transform each value to an integer.
```js ```js
const digitize = n => [...('' + n)].map(i => parseInt(i)); const digitize = n => [...(`${n}`)].map(i => parseInt(i));
``` ```
```js ```js