The Super Power of Array in Javascript

An array in JavaScript can contain not only simple data types but also more complex ones, such as arrays, functions, and other objects. 


For example,

let myArray = [
  1,
  "Hello",
  true,
  [2, 4, 6],
  {
    name: "John",
    age: 30
  },
  function() {
    console.log("This is a function inside an array");
  }
];



console.log(myArray[3][1]); 
// Output: 4

myArray[5](); 
// Output: This is a function inside an array