This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
If you use a named index when accessing an array, JavaScript will redefine the array to a standard object, and some array methods and properties will produce undefined or incorrect results.
const person = []; person["firstName"] = "John"; person["lastName"] = "Doe"; person["age"] = 46; document.getElementById("demo").innerHTML = person[0] + " " + person.length;
Using named indexes changes the array to objects.