1var length = 5;
2var array = [];
3var i = 0;
4
5for (i = 0; i != length; i++){
6 array.push(i)
7 //array.push is used to push a value inside array
8}
9
10console.log(array);
11
12//console.log is used to check array value inside your console
1var colors = ['red','blue','green'];
2
3/*// OUTPUT
4---------------------------*/
5console.log(colors[1]); // Outputs 'blue'