JanetDocsI'm feeling luckyGithub sign in

array/pop



    cfunction

    (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.


1 exampleSign in to add an example
Loading...
(def a @[1 2])
(array/pop a)  # => 2
a              # => @[1]
(array/pop a)  # => 1
a              # => @[]
(array/pop a)  # => nil
a              # => @[]
cellularmitosis