Splice
methodsChanges an ObservableArray by adding new items while removing old items. An equivalent of Array.prototype.splice.
The
splicemethod raises thechangeevent once or twice depending on the change. Theactionfield of the event argument is set to"add"(if items are added) or"remove(if items are removed). Theitemsfield of the event argument is the array that contains the appended items or removed items. In the previous example, thechangeevent will be triggered two times—the first one, becausebaseballis removed and, the second one, becausetennisandhockeyare added.
An index at which the changing of the array will start.
An integer which indicates the number of the items for removal. If set to 0, no items will be removed. In this case, you have to specify at least one new item.
—Contains the removed items. The result of the splice method is not an instance of ObvservableArray.