From 0afd7a8777b99233122e3d6792a07dff217fa7f9 Mon Sep 17 00:00:00 2001 From: lvzhenbang Date: Sun, 24 Dec 2017 17:50:24 +0800 Subject: [PATCH] [bug] change Array.slice() for String.slice() useage: Array.slice() should be changed to String.slice() --- snippets/extendHex.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/extendHex.md b/snippets/extendHex.md index bda2cdd5e..8c7773c5e 100644 --- a/snippets/extendHex.md +++ b/snippets/extendHex.md @@ -3,7 +3,7 @@ Extends a 3-digit color code to a 6-digit color code. Use `Array.map()`, `split()` and `Array.join()` to join the mapped array for converting a 3-digit RGB notated hexadecimal color-code to the 6-digit form. -`Array.slice()` is used to remove `#` from string start since it's added once. +`String.slice()` is used to remove `#` from string start since it's added once. ```js const extendHex = shortHex => '#' + shortHex.slice(shortHex.startsWith('#') ? 1 : 0).split('').map(x => x+x).join('')