In this example, declare an array person
= [] and assign the values in arrays: var person
= []; person[0] = "Michael"; person[1] = "Voughan"; person[2] = 50; document.getElementById("sample").innerHTML
= person[1] + " " + person.length; See the code snippet: