jQuery isEmptyObject() methodThe isEmptyObject() method is used to determine whether the passed argument is an empty object or not. It returns a Boolean value. If it finds the passed value is an empty object, it returns true. Otherwise, it returns false. A plain object is created using the "{}" or by using "new Object". So, the isEmptyObject() method returns true if the objects are empty and are created using the "{}" or by using the "new Object()". We can use the $. isPlainObject() to check whether an object is a plain JavaScript object or not. SyntaxThe commonly used syntax of this method is given below - This method accepts a single parameter, which is defined as follows - obj - It is the object to be checked to see whether it is an empty object or not. Let's understand the working of the isEmptyObject() method, using some illustrations. Example1In this example, we are using the isEmptyObject() method to determine whether the passed value is an Empty object or not. Here, we are passing different values such as {}, Object, etc. as an argument. Test it NowOutput After the execution of the above code, the output will be - ![]() Example2Here, we are passing array and string as the argument of the isEmptyObject() method to check whether the method return true or false. Test it NowOutput ![]()
Next TopicjQuery isArray() method
|