You can also assign a new value to an index. Type and run the following code:
// Assign a new value, "Soy Milk" to index 2
shoppingList[2] = "Soy Milk"
shoppingList
ShoppingList now consists of "Eggs", "Chicken", "Soy Milk", and "Cooking Oil", and you can see this in the Results area.
Note that the index used must be valid.
Now, let's learn how to remove items from arrays.