4 ms·
If ya don't want to do includes, ` window.$ = document.querySelector.bind(document) window.$$ = document.querySelectorAll.bind(document) `
by dpweb 2y ago
If ya don't want to do includes,
`
window.$ = document.querySelector.bind(document)
window.$$ = document.querySelectorAll.bind(document)
`
- qingcharles 2y agoThanks, this is the more useful bit of the code to me. edit: how about this so you can use array functions too when you need? window.$ = document.querySelector.bind(document); window.$$ = document.querySelectorAll.bind(document); window.$$$ = (selector) => Array.from(document.querySelectorAll(selector));
- deleted 2y ago[deleted]
- janalsncm 2y agoI’ve been doing this for years. Lightweight but still saves me a ton of time.