Arrays


function add() { 
   var tempValue = 0;
   for (i=0; I < arguments.length; i++) {
      tempValue += arguments[i];
   }
   return tempValue;
}

var myValue = add(1,2,3,4);
alert(myValue);


var people = []; 
people[0] = "steve";
people[1] = "john";
people[2] = "david";


var people = ["steve","john,"david"]; 


for (I in people) { 
   alert(people[i]);
}


Associative Arrays

var assArray = []; 
assArray["one"] = "myvalue";
assArray["two"] = "myvalue2";
alert(assArray["two"]);



© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

PrevNext