in array method code example
Example 1: array javascript
special_dates = [];
special_dates.push(new Date('2021/02/12').getTime());
special_dates.push(new Date('2021/02/13').getTime());
special_dates.push(new Date('2021/02/14').getTime());
for (var i = 0; i < special_dates.length; i++) {
console.log(special_dates[i]) ;
}
Example 2: access index of array javascript
let first = fruits[0]
// Apple
let last = fruits[fruits.length - 1]
// Banana