-
Notifications
You must be signed in to change notification settings - Fork 15
JSArray.Slice
boxgaming edited this page Jul 25, 2026
·
3 revisions
Returns a copy of a portion of an array into a new array object selected from a specified starting and ending index.
newArray = JSArray.Slice ( a, start% [, end%] )
- The a parameter contains the native JavaScript array on which the operation will be performed.
- The start% parameter indicates the zero-based index at which to start extraction. If not specified, all elements to the end of the array will be exctracted.
- The optional end% parameter indicates the zero-based index at which to end extraction.
Import JSArray From "lib/lang/array.bas"
Dim animals As Object
animals = JSArray.Create("ant", "bison", "camel", "duck", "elephant")
Print JSArray.Slice(animals, 2)
Print JSArray.Slice(animals, 2, 4)
Print JSArray.Slice(animals, 1, 5)camel,duck,elephant
camel,duck
bison,camel,duck,elephant