An array is a special variable, which can hold more than one value at a time. JavaScript arrays are lists like variables, users…