yak
v0.1.0
Published
A functional invoke method
Downloads
47
Readme
yak
A functional method to invoke a method from an object.
usage
example 1
var x = 123;
var results = yak("toString")(x);
// results = '123'
example 2
var objs = [
{foo: function() { return this.bar.split('').reverse().join('') }, bar: 'bam'},
{foo: function() { return this.bar.split('').reverse().join('') }, bar: 'baz'},
]
var results = objs.map(yak('foo'));
// results should equal ['mab','zab']
install
npm install yak
contribute
pull requests welcome
license
MIT