Files
30-seconds-of-code/snippets/show.md
Angelos Chalaris 611729214a Snippet format update
To match the starter (for the migration)
2019-08-13 10:29:12 +03:00

16 lines
381 B
Markdown

---
title: show
tags: browser,css,beginner
---
Shows all the elements specified.
Use the spread operator (`...`) and `Array.prototype.forEach()` to clear the `display` property for each element specified.
```js
const show = (...el) => [...el].forEach(e => (e.style.display = ''));
```
```js
show(...document.querySelectorAll('img')); // Shows all <img> elements on the page
```