Hello I’m trying to alias the two functions from the title like so
const $ = document.querySelector;
const $$ = document.querySelectorAll;
$$("a")
But upon running $$("a")
i get error Uncaught TypeError: Illegal invocation
.
Why is that?
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
Hello I’m trying to alias the two functions from the title like so
const $ = document.querySelector;
const $$ = document.querySelectorAll;
$$("a")
But upon running $$("a")
i get error Uncaught TypeError: Illegal invocation
.
Why is that?