pop
Retrieves a new array without the last element from an input array
(pop arr)Returns
Parameters
Examples
(pop [1, 2, 3])
;;=> [1, 2]
(def arr1 [1, 2, 3])
(pop arr1)
;;=> [1, 2]
arr1 ;; arr1 remains the same
;;=> [1, 2, 3]
(pop! arr1)
;;=> 3
arr1
;;=> [1, 2]
Last updated