Travis build: 283
This commit is contained in:
@ -3679,17 +3679,17 @@ hashBrowser(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then
|
||||
|
||||
Hides all the elements specified.
|
||||
|
||||
Use the spread operator (`...`) and `Array.forEach()` to apply `display: none` to each element specified.
|
||||
Use `NodeList.prototype.forEach()` to apply `display: none` to each element specified.
|
||||
|
||||
```js
|
||||
const hide = (...el) => [...el].forEach(e => (e.style.display = 'none'));
|
||||
const hide = els => els.forEach(e => (e.style.display = 'none'));
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
hide(...document.querySelectorAll('img')); // Hides all <img> elements on the page
|
||||
hide(document.querySelectorAll('img')); // Hides all <img> elements on the page
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user