It is used to add the specified model at the beginning of a collection.
models − It contains the names of the collection instances, which is to be added at the beginning of a collection.
options − It includes the model types and adds them to the collection instance.
Let us carry out the following steps to see how the above code works −
Save the above code in the unshift.htm file.
Open this HTML file in a browser.