</div>(注意:div用于简单性;可以是许多不同的元素类型。)Array.prototype.filter.call(document.querySelectorAll("div"), el => /quick\s+brown/.test(el.innerText))
Array.prototype.filter.call(document.querySelectorAll("div"), el =>
为了获得匹配的元素和循环,我使用querySelectorAll和forEach数组方法。据称,querySelectorAll将返回一个nodelist。我也可以通过获取匹配的元素来使用getElementsByClassName,但不能直接使用forEach。但是链接告诉我们它还返回一个nodelist对象。它引发一个错误,forEach is not a function
请告诉我为什么forEach不直接处理getElementsByClassName的返回,而getElemen