From 74ae6b7f779dd7dff74d28bef8d9780cbcd5d23b Mon Sep 17 00:00:00 2001 From: Les Date: Fri, 5 Jan 2018 11:38:34 +0000 Subject: [PATCH] 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. --- snippets/digitize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/digitize.md b/snippets/digitize.md index 60f636847..769b4e60c 100644 --- a/snippets/digitize.md +++ b/snippets/digitize.md @@ -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. ```js -const digitize = n => [...('' + n)].map(i => parseInt(i)); +const digitize = n => [...(`${n}`)].map(i => parseInt(i)); ``` ```js