Skip to content

Instantly share code, notes, and snippets.

@kessler
Last active March 20, 2016 20:40
Show Gist options
  • Save kessler/5e62c350e243d11bea25 to your computer and use it in GitHub Desktop.
Save kessler/5e62c350e243d11bea25 to your computer and use it in GitHub Desktop.
var el = {}
var props = Object.keys(el)
propes.forEach(function (p) {
el[p] = function(v) {
}
})
//----------------------------
function createGetter(p, el) {
return function (v) {
// do something with el[p]
}
}
for (var p in el) {
el[p] = createGetter(p, el)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment