DEV Community

Discussion on: Snippets for Vanilla JS Coding

Collapse
 
1hko profile image
1hko • Edited

Instead of startNode||D I would recommend default arguments – it's exactly the reason they were added to the language

const $$ = (selector, elem = D) =>
  elem.querySelectorAll(selector)
Collapse
 
learosema profile image
Lea Rosema (she/her)

Good point :)