Array elements can be changed using the index number let's change the first element of our array to
Kiwi
we'll start off with the name of the array fruits and then specify the index number corresponding to
the value we want to amend
and that's it.
Once we save our file we can preview it in our web browser
and we can now see that the first value Apple has been amended to Kiwi
if we were to change the index number let's say the three
and save our file and refresh
we can see that grape has now changed to Kiwi
we can also delete elements in an array using index numbers as well.
Let's delete pear from our list of elements since pear would have the index number two.
We can type the following
we'll save our file
and in our web browser we can now see that there is an empty space where pear would have appeared.