Lodash - isObject method



Syntax

_.isObject(value)

Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))

Arguments

  • value (*) − The value to check.

Output

  • (boolean) − Returns true if value is an object, else false.

Example

var _ = require('lodash');

console.log(_.isObject({}));
console.log(_.isObject('3'));

Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

Output

true
false
lodash_lang.htm
Advertisements