Javascript can be dynamically typed – Array Example

This is code example of javascript being dynamically typed with arrays. Arrays can store, anything: strings, objects, functions, strings, and integers. Below is example how to call an object lateral and function. Remember arrays start count at 0.

var arr = [1,
           2,
           3,
           {
           name: 'jason',
             addy: '111 fake st'
           },
           function(name){
           	var greeting = 'hello ';
             console.log(greeting + name);
           },
           'hello'
          ];
arr[4](arr[3].name);

// hello jason