Edit this page

slice

Returns a one-level deep copy of a portion of an array. Equivalent of Array.prototype.slice. The result of the slice method is not an instance of ObvservableArray. It is a regular JavaScript Array object.

Important: The slice method does not modify the original ObservableArray.

Parameters

begin Number

Zero-based index at which to begin extraction.

end Number

Zero-based index at which to end extraction. If end is omitted, slice extracts to the end of the sequence.

Example - slice items from an ObservableArray

<script>
var array = new kendo.data.ObservableArray([1, 2, 3]);
var firstAndSecond = array.slice(0, 2);
console.log(firstAndSecond); // outputs [1, 2]
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy