Last active
June 28, 2017 11:01
-
-
Save 3rd-Eden/cbc853c9ad7ca55668e8 to your computer and use it in GitHub Desktop.
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
function Car() { | |
this.type = 'fo sho' | |
} | |
Object.defineProperty(Car.prototype, 'is', { | |
get: function getterson() { | |
var car = this; | |
function named(args) { | |
args = named.curry.concat(Array.prototype.slice.call(arguments, 0)); | |
return args[0] === 'foo' && car.type === args[1]; | |
} | |
named.curry = [] | |
return named; | |
} | |
}); |
Author
3rd-Eden
commented
Jun 20, 2014
you cannot do car.is.bind(car, 'BMW')
var car = new Car();
var is = car.is;
is.curry.push('foo', 'fo sho');
console.log(is()) // true
This really should have more subscribers! xD
can you make that it would resolve
is.legen.dairy('milk', 'van')
?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment