hide all elements specified

PHOTO EMBED

Sat Feb 26 2022 02:14:12 GMT+0000 (UTC)

Saved by @mboljar

const hide = (...el) => [...el].forEach(e => (e.style.display = 'none'));

// Example
hide(document.querySelectorAll('img')); // Hides all <img> elements on the page
content_copyCOPY

https://madza.hashnode.dev/24-modern-es6-code-snippets-to-solve-practical-js-problems?guid