Hides all the elements specified.

Use NodeList.prototype.forEach() to apply display: none to each element specified.

代码片段

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

使用样例

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