It is used to add a model or array of models to the collection.
models − It contains the names of the collection instances, which need to be added in the collection.
options − It includes 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 add.htm file.
Open this HTML file in a browser.