Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

is array also an object

// Prove that Array is also an Object in JavaScript
// Method -1
let arr = [];
console.log(typeof arr);

// Method -2
let arr2 = [];
if (Array.isArray(arr2)) {
   console.log(`Array is an Object in JavaScript`);
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #array #object
ADD COMMENT
Topic
Name
4+1 =