Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by Zardoz84

13 hours ago

const $ = document.querySelectorAll

2 comments

Zardoz84

Reply

Tistron  7 hours ago

I usually do

   const $ = (s, e = document) => e.querySelector(s)

and a similar one for $$.

recursive  9 hours ago

Probably have to bind the this value.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities