jQuery isArray() methodThe isArray() method is used to test whether the passed argument is an array or not. This method returns a Boolean value. If it finds the passed value is an array, it returns true. Otherwise, it returns false. SyntaxThis method accepts a single parameter, which is defined as follows - obj - It is any object to test whether it is an array or not. Let's understand the working of the isArray() method, using some illustrations. Example1In this example, we are using the isArray() method to determine whether the passed arguments are array or not. Here, we are passing curly braces {}, and square brackets [] as an argument. Test it NowOutput After the execution of the above code, the output will be - Example2In this example, we are using the isArray() method for checking different values to see whether the method returns true or false. We are defining an array arr for which the method returns true, and for other values such as undefined, null, true, isArray() method will return false. Test it NowOutput After the execution of the above code, the output will be - Next TopicjQuery focusout() method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India