Displace method can be used to add multiple new items to an array.
This method also allows us to specify the position of the new element and also if any elements should
be removed let's go through an example to better illustrate this concept see we wanted to add two fruits
lemon and banana.
After the second element in our array which is orange to do this we can type the following.
We start with the variable name
and then we create our splice method.
The value 2 indicates that we want the new elements to start with an index number of 2 the 0 indicates
that we do not want to remove any of the other elements in our array
once we save our file and previewed in our web browser
we can see that lemon and banana have been added after orange lemon does have an index value of 2 so
the output is correct.