jssvdcritp array methods code example

Example 1: javacript array

[element0, element1, ..., elementN]

new Array(element0, element1[, ...[, elementN]])
new Array(arrayLength)

Example 2: functions in arrays javascript

var argsContainer = ['hello', 'you', 'there'];
var functionsContainer = [];

for (var i = 0; i < argsContainer.length; i++) {
var currentArg = argsContainer[i]; 

  functionsContainer.push(function(currentArg){
    console.log(currentArg);
  });
};

for (var i = 0; i < functionsContainer.length; i++) {
  functionsContainer[i](argsContainer[i]);
}