Sunday, November 16, 2025
HomeLanguagesJavascriptUnderscore.js _.isObject() Function

Underscore.js _.isObject() Function

The _.isObject() function is used to check whether the given object is an object or not. It returns a Boolean value True if the given object element is an object and returns False otherwise. JavaScript functions and arrays are objects, while the strings and numbers are not objects.

Syntax:

_.isObject( value )

Parameters: This function accepts one parameter as mentioned above and described below:

  • object: This parameter holds the value of object that need to be check whether it is an object or not.

Return Value: It returns True if the given object element is an object and False otherwise.

Example 1:




<!DOCTYPE html>
<html>
  
<head>
    <script type="text/javascript" src=
    </script>
</head>
  
<body>
    <script type="text/javascript">
  
        var info = {
            Company: { name: 'neveropen' },
            Contact: { Address: { 
                AddressInfo: 'Noida', 
                ContNo: '+91 9876543210' 
            } }
        };
  
        console.log(_.isObject(info));
    </script>
</body>
  
</html>


Output:

Example 2:




<!DOCTYPE html>
<html>
  
<head>
    <script type="text/javascript" src=
    </script>
</head>
  
<body>
    <script type="text/javascript">
  
        console.log(_.isObject(true));
        console.log(_.isObject(1));
        console.log(_.isObject('neveropen'));
        console.log(_.isObject([1, 2, 3]));
    </script>
</body>
  
</html>


Output:

RELATED ARTICLES

Most Popular

Dominic
32402 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6768 POSTS0 COMMENTS
Nicole Veronica
11919 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11990 POSTS0 COMMENTS
Shaida Kate Naidoo
6897 POSTS0 COMMENTS
Ted Musemwa
7149 POSTS0 COMMENTS
Thapelo Manthata
6850 POSTS0 COMMENTS
Umr Jansen
6841 POSTS0 COMMENTS