VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-array-isarray-method/

⇱ JavaScript Array isArray() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Array isArray() Method

Last Updated : 8 Jun, 2026

The isArray() method in JavaScript is used to determine whether a given value is an array or not. This method returns true if the argument passed is an array else it returns false.

Syntax:

Array.isArray(obj);

Parameters:

  • obj: This parameter holds the object that will be tested.

Return value:

This function returns the Boolean value true if the argument passed is an array otherwise it returns false. 

Example 1: Checking if a Value is an Array using Array.isArray()

The code defines a function func() checking if 'foobar' is an array using Array.isArray(). It logs false. 'foobar' isn't an array, confirming the method's accuracy.


Example 2: Passing map in isArray() Method

Since the argument passed to the function isArray() is a map therefore this function returns false as the answer.


Example 3: Illustration of Array.isArray() Method on nested Array.

We have a complete list of Javascript Array methods, to check those please go through this Javascript Array Complete reference article.

Comment