- return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach)
- // eslint-disable-next-line no-prototype-builtins -- safe
- || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own;
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.forEach)
+ || hasOwn(DOMIterables, classof(it)) ? method : own;