ply

Function.prototype.apply wrappers.

Synopsis

ply is a collection of wrappers around Function.prototype.apply.

Why?

It's trivial to implement, but in order to keep code DRY (and avoid silly mistakes) it makes sense to define this function only once per project. This library is the logical consequence of that.

Install

npm install ply
git clone https://github.com/pluma/ply.git
cd ply
npm install
make
component install pluma/ply

Learn more about component.

bower install ply

Learn more about bower.

Download the latest minified CommonJS release and add it to your project.

Learn more about CommonJS modules.

Download the latest minified AMD release and add it to your project.

Learn more about AMD modules.

Download the latest minified standalone release and add it to your project.

<script src="/your/js/path/ply.globals.min.js"></script>

This makes the ply module available in the global namespace.

Basic usage example

var mcall = require('ply').mcall;
 
mcall(console, 'log', 'Hello', 'World'); // 'Hello' 'World' 

API

Equivalent to the following:

fn.apply(self, args);

Equivalent to the following:

fn.call(self, args...);

Equivalent to the following:

fn.apply(this, args);

Equivalent to the following:

fn.call(this, args...);

Equivalent to the following:

obj[name].apply(obj, args);

Equivalent to the following:

obj[name].call(obj, args...);

Unlicense

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.