Lodash _.isArguments() Method

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.

javascript




// Requiring the lodash library
const _ = require('lodash');
 
// Using the _.isArguments() method
let argu = _.isArguments(function () { return arguments; }());
 
// Printing the output
console.log(argu);


Output:

true

Example 2: In this example, we are getting false as output because the given value is not an argument object.

javascript




// 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:

false

Note: This code will not work in normal JavaScript because it requires the library lodash to be installed.