is-args
Quickly check if a variable is an Arguments object
Last updated 13 years ago by jaycetde .
MIT · Repository · Original npm · Tarball · package.json
$ npm install is-args 
SYNC missed versions from official npm registry.

is-args

Quickly check if a variable is Arguments.


var isArgs = require('is-args');

isArgs((function () { return arguments; })(1, 2, 3));
// true;

isArgs([1, 2, 3]);
// false;

Installation

$ npm install is-args

Limitations

This is not the standard Object.prototype.toString.call(val) === '[object Arguments]' method. This method is much faster than the toString method, however, there is a chance that you may get false positives on objects that resemble arguments:


var x = [1,2,3];
x.callee = function () {};

isArguments(x);
// true

Keep this in mind as you work with this module.

Current Tags

  • 0.0.1                                ...           latest (13 years ago)

2 Versions

  • 0.0.1                                ...           13 years ago
  • 0.0.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 6
Today 1
This Week 2
This Month 6
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE