slice
can.Observe.List.prototype.slice
Make a copy of a part of a List.
list.slice([start[, end]])
slice creates a copy of a portion of the List.
Parameters
-
start
=0{Number}Optionalthe index to start copying from
-
end
{Number}Optionalthe first index not to include in the copy If end is not supplied,
slicewill copy until the end of the list.
Returns
{can.Observe.List}
a new can.Observe.List with the extracted elements
sliceis the simplest way to copy a List: