Javascript array isArray() is an inbuilt function that determines whether the passed value is an array or not. If the value is an array, then true is returned; otherwise, false is return. When checking for the Array instance, the isArray() function is preferred over the instanceof because it works through iframes.

So, if you want to check if the input value is an  array or not then we can use the Javascript isArray() function.

There are some use cases like let say, we are fetching the json data from the server and then we convert it into an  object and then if we wanted to make sure that the data object contains the array values or not then we can use the isArray() function.

We can check the data type of any value of Javascript using  typeof operator.

#javascript #javascript array isarray #js

Javascript Array isArray Tutorial With Example | Array.isArray() Function
1.20 GEEK