var shoppingList = ["milk", "eggs", "sugar", "bread", "cake"];
JavaScript
Which line of code will correctly change "cake" to "apples"?
shoppingList["cake"] = "apples";
JavaScript
shoppingList["apples"] = "cake";
JavaScript
shoppingList[4] = "apples";
JavaScript
shoppingList[5] = "apples";
1 answer
shoppingList[4] = "apples";