Q). What do arrays allow us to do?
A). Arrays in JavaScript enables multiple values to be stored in a single variable. It stores the same kind of element collection sequential fixed-size. Arrays in JavaScript are used to store an information set, but it is often more helpful for storing a set of variables of the same type.
Q). What index should you use in order to access the first element in an array?
A).JavaScript arrays are zero-indexed. The first element of an array is at index 0, and the last element is at the index value equal to the value of the array’s length property minus 1.
// ‘ACCESSING ARRAY ELEMENTS.’
let arr = [‘this is the first element’, ‘this is the second element’, ‘this is the last element’]
console.log(arr[0]) // logs ‘this is the first element’
console.log(arr[1]) // logs ‘this is the second element’
console.log(arr[arr.length - 1]) // logs ‘this is the last element’