Arrays are Objects

In JavaScript, arrays are indeed objects, and as such, they inherit properties and methods from the Array.prototype object. This allows…