One can push certain items to an array making the last index the newly added item. It changes the length of an array and returns a new length.
let array = [1, 2, 3]; array.push(4); console.log(array); // Result: array = [1, 2, 3, 4]
Last updated 3 years ago