Skip to content

Instantly share code, notes, and snippets.

@wonminjeon
wonminjeon / bling.js
Created June 11, 2018 16:03
Because you want the $ of jQuery without the jQuery.
// based on https://gist.github.com/paulirish/12fb951a8b893a454b32
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line