Skip to content

JSArray.Pop

boxgaming edited this page Jul 25, 2026 · 2 revisions

Removes the last element from an array and returns that element.

Syntax

result = JSArray.Pop ( a )

Parameters

  • The a parameter contains the native Javascript array on which the operation will be performed.

Example

Import JSArray From "lib/lang/array.bas"

Import JSArray From "lib/lang/array.bas"

Dim plants As Object
plants = JSArray.Create("broccoli", "cauliflower", "cabbage", "kale", "tomato")

Print JSArray.Pop(plants)
Print JSArray.Join(plants)
Print
Print JSArray.Pop(plants)
Print JSArray.Join(plants)

Output

tomato
broccoli,cauliflower,cabbage,kale

kale
broccoli,cauliflower,cabbage

See Also

JSArray.Create
JSArray.Join
JSArray.Push
JSArray.Shift
JavaScript - Array.pop()

Clone this wiki locally