Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80742 views
1
var isArrayLike = require('../internal/isArrayLike'),
2
isObjectLike = require('../internal/isObjectLike');
3
4
/** `Object#toString` result references. */
5
var argsTag = '[object Arguments]';
6
7
/** Used for native method references. */
8
var objectProto = Object.prototype;
9
10
/**
11
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
12
* of values.
13
*/
14
var objToString = objectProto.toString;
15
16
/**
17
* Checks if `value` is classified as an `arguments` object.
18
*
19
* @static
20
* @memberOf _
21
* @category Lang
22
* @param {*} value The value to check.
23
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
24
* @example
25
*
26
* _.isArguments(function() { return arguments; }());
27
* // => true
28
*
29
* _.isArguments([1, 2, 3]);
30
* // => false
31
*/
32
function isArguments(value) {
33
return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;
34
}
35
36
module.exports = isArguments;
37
38