Why are certain function calls termed “illegal invocations” in JavaScript?
It’s because you’ve lost the “context” of the function. When you call: document.querySelectorAll() the context of the function is document, and will be accessible as this by the implementation of that method. When you just call q there’s no longer a context – it’s the “global” window object instead. The implementation of querySelectorAll tries to … Read more