enslave
v0.0.2
Published
binds `this` to a function's first argument
Downloads
13
Readme
What is enslave
?
enslave
is the inverse function of liberate
Usage
var enslave = require('enslave')
function add(a, b){ return a.value + b.value }
var n = {add: enslave(add)}
var A = Object.create(n)
A.value = 1
var B = Object.create(n)
B.value = 2
A.add(B) // returns 3
Credits
Ripped straight from sinful.js, as I found it useful on its own.