yak

0.1.0 • Public • Published

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

Thanks to

Readme

Keywords

none

Package Sidebar

Install

npm i yak

Weekly Downloads

0

Version

0.1.0

License

none

Last publish

Collaborators

  • jackhq