From cb04896fece7e3006da1c8749b1aba3dfb2f6082 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 8 Jan 2018 18:22:14 +0800 Subject: [PATCH 1/2] fix hide err --- snippets/hide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/hide.md b/snippets/hide.md index 82a02a4b0..ea197954a 100644 --- a/snippets/hide.md +++ b/snippets/hide.md @@ -5,7 +5,7 @@ Hides all the elements specified. Use the spread operator (`...`) and `Array.forEach()` to apply `display: none` to each element specified. ```js -const hide = (...el) => [...el].forEach(e => (e.style.display = 'none')); +const hide = el => [...el].forEach(e => (e.style.display = 'none')); ``` ```js From ee439b19da032f91c468d08e14793d2cfd8d4438 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 8 Jan 2018 12:41:36 +0200 Subject: [PATCH 2/2] Update hide.md --- snippets/hide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/hide.md b/snippets/hide.md index ea197954a..a80888583 100644 --- a/snippets/hide.md +++ b/snippets/hide.md @@ -5,9 +5,9 @@ Hides all the elements specified. Use the spread operator (`...`) and `Array.forEach()` to apply `display: none` to each element specified. ```js -const hide = el => [...el].forEach(e => (e.style.display = 'none')); +const hide = (...el) => [...el].forEach(e => (e.style.display = 'none')); ``` ```js -hide(document.querySelectorAll('img')); // Hides all elements on the page +hide(...document.querySelectorAll('img')); // Hides all elements on the page ```