This is all I personally ever need.
function $(q) { return document.querySelector(q) } function $(q) { return document.querySelector(q) } function $(q, parent) { return (parent || document).querySelector(q); } function $(q, parent) {
parent = parent || document;
return [].slice.call(parent.querySelectorAll(q));
} Array.from(<NodeList or other iterable>)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... $ = document.querySelector.bind(document);
would be sufficient? ;)with experimental ES7 syntax :D https://github.com/zenparsing/es-function-bind