-
Notifications
You must be signed in to change notification settings - Fork 15
JSArray.Unshift
boxgaming edited this page Jul 25, 2026
·
2 revisions
Adds the specified elements to the beginning of an array.
JSArray.Unshift a, item1 [, item2, ... itemN]
- The a parameter contains the native Javascript array on which the operation will be performed.
- One or more item parameters can be passed to the method. Items will be added to the beginning of the array in the order they appear in the list.
Import JSArray From "lib/lang/array.bas"
Dim numbers As Object
numbers = JSArray.Create("one", "two")
JSArray.Unshift numbers, "three"
Print JSArray.Length(numbers)
Print JSArray.Join(numbers)
JSArray.Unshift numbers, "four", "five", "six"
Print JSArray.Length(numbers)
Print JSArray.Join(numbers)3
three,one,two
6
four,five,six,three,one,two
JSArray.Create
JSArray.Join
JSArray.Length
JSArray.Push
JSArray.Shift
Javascript - Array.unshift()