Question #149

Author: admin
document.querySelectorAll('.some-class')
  .forEach((elem) => {
    // do something
  });
Is this code correct?
Yes
No, if the querySelectorAll returns null, an error occurs:
TypeError: Cannot read properties of null (reading 'forEach')
No, querySelectorAll() returns an array-like object, that does not have a forEach() method.
No, forEach() argument must be a normal function, not an arrow function.
Rate the difficulty of the question:
easyhard