DEV Community
You spread the list like this:
const elements = document.getElementsByClassName('modal');
[...elements].forEach((element)=> {
console.log(element)
})
Or in one line like this, this is useful if you are doing multiple loops and do not want to spread every time:
const elements = [...document.getElementsByClassName('modal')];
elements.forEach((element)=> {
console.log(element)
})
For further actions, you may consider blocking this person and/or reporting abuse
Read next

Implementing Protected Dashboards Using Node.JS
Bhavya Jain -

Unveiling CeCILL 2.1: A Deep Dive into an Evolving Open Source License
JennyThomas498 -

Exploring WebRTC with React
Bhavya Jain -

DEV.to API를 통한 자동 포스팅 테스트
dunder Kim (Hyeong) -
Top comments (0)