Files
30-seconds-of-code/snippets/show.md
2017-12-28 23:33:21 +02:00

14 lines
326 B
Markdown

### show
Shows all the elements specified.
Use the spread operator (`...`) and `Array.forEach()` to clear the `display` property for each element specified.
```js
const show = (...el) => [...el].forEach(e => e.style.display = '');
```
```js
show(document.querySelector('img')); // Shows all <img> elements on the page
```