JanetDocsPlaygroundI'm feeling luckyGitHub sign in

array/pop



    cfunction
    src/core/array.c on line 165, column 1

    (array/pop arr)

    Remove the last element of the array and return it. If the array is 
    empty, will return nil. Modifies the input array.


3 examplesSign in to add an example
Loading...
(array/pop @[]) # => nil
jgartePlayground
(array/pop (range 12)) # => 11
jgartePlayground
(def a @[1 2])
(array/pop a)  # => 2
a              # => @[1]
(array/pop a)  # => 1
a              # => @[]
(array/pop a)  # => nil
a              # => @[]
cellularmitosisPlayground