querySelectorAll() returns all elements matching a CSS selector. Unlike getElementsByClassName, it returns a static NodeList.
const items = document.querySelectorAll(".item");
items.forEach(item => console.log(item));
"Static" means the list doesn't update when the DOM changes.