isArray() in javascript - How to check is array or not

     The Array.isArray() method returns true if an object is an array, false if it is not. It will check the specified value is array or not, if it is array return true value and if not return false.

Syntax

   Array.isArray(variable or value);
Example

   var ar=[10,20,30];
   alert(Array.isArray(ar));


Example Program:- (Editor)


Editor is Loading...

Advertisement

Nhận xét

Bài đăng phổ biến từ blog này

How to set the SDK, NDK and JDK path to android studio?

physicsjs - Increase the restitution value for circle and retangle

Select all values from list box in a single click using javascript