Suppose I have created a custom function that should return a NodeList:
getNodeList('foo');
I anticipate that this NodeList will match the NodeList returned from:
document.querySelectorAll('.foo');
Is there a way to verify if my assumptions are accurate?
The following comparison method does not yield the desired result:
getNodeList('foo') == document.querySelectorAll('.foo')
It seems like there must be a technical reason why this doesn't work, as evidenced by
document.querySelectorAll('.foo') == document.querySelectorAll('.foo')
, which also fails. This outcome is expected.
How can I determine whether two NodeLists contain identical HTML nodes?