Last active
August 29, 2015 14:11
-
-
Save vnys/8f73faa512ad21be9f1f to your computer and use it in GitHub Desktop.
Bondage (bind lib)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tag = document.createElement.bind(document), | |
txt = document.createTextNode.bind(document), | |
get = document.querySelector.bind(document), | |
getall = document.querySelectorAll.bind(document), | |
log = console.log.bind(console); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var div = tag('div'); | |
div.appendChild(txt('tjobing')); | |
log(div); | |
var anotherDiv = get('div'); | |
var aBunchOfDivs = getall('div'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, we can use «get»: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords