is-args

0.0.1 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i is-args

Weekly Downloads

214

Version

0.0.1

License

MIT

Last publish

Collaborators

  • jaycetde