sara


Arrays

//define an array
var students = ["John", "Ann", "Kevin"];

//ad a new item to the array
students.push("sara");

//replace an item in an array
students[2]="sara";


//loop in array
    

for (var i=0; i<students.length; i++){
 console.log(i,   students[i]);
}
    

Add to: