Lodash _.isArguments() method checks if the value is likely an arguments object.
Syntax:
_.isArguments(value);Parameters:
- value: It is the function that is used to check the value.
Return Value:
- This method returns true if the value is an argument object else false.
Example 1: In this example, we are getting true as output because the given value is an argument object.
// Requiring the lodash library
const _ = require('lodash');
// Using the _.isArguments() method
let argu = _.isArguments(function () { return arguments; }());
// Printing the output
console.log(argu);
Output:
trueExample 2: In this example, we are getting false as output because the given value is not an argument object.
// Requiring the lodash library
const _ = require('lodash');
// Original array
let object = _.isArguments([7, 7, 8]);
// Using the _.isArguments() method
let argu = _.isArguments(object);
// Printing the output
console.log(argu);
Output:
falseNote: This code will not work in normal JavaScript because it requires the library lodash to be installed.