New to Kendo UI for jQueryStart a free 30-day trial

Unshift

methods

Adds one or more items to the beginning of an ObservableArray and returns the new length. An equivalent of Array.prototype.unshift.

The unshift method raises the change event. The action field of the event argument is set to "add". The items field of the event argument is an array that contains the new items.

Returns:Number

—The new length of the array.

<script>
var array = new kendo.data.ObservableArray([2, 3]);
var result = array.unshift(0, 1);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(result); // outputs "4"
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(array); // outputs [0, 1, 2, 3]
</script>
Not finding the help you need?
Contact Support