The DOM method document.querySelectorAll()
(and a few others) return a NodeList
.
To operate on the list, e.g. using forEach()
, the NodeList
must first be converted to an Array
.
What's the best way to convert the NodeList
to an Array
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…