0

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?

Boris Grunwald
  • 2,064
  • 1
  • 16
  • 28

0 Answers0