const $ = document.querySelector;
// TypeError: Illegal invocation
const el = $('.some-element');
const $ = document.querySelector.bind(document);
// Or:
const $ = (...args) => document.querySelector(...args);
const $ = document.querySelector;
// TypeError: Illegal invocation
const el = $('.some-element');
const $ = document.querySelector.bind(document);
// Or:
const $ = (...args) => document.querySelector(...args);
<!DOCTYPE html>