Hacker News new | ask | show | jobs
by abritinthebay 3667 days ago
If you're using ES6 you may as well use spread and defaults to make it more useful:

const $ = (selector, context=document) => [...context.querySelectorAll(selector)]