first

added
1.0

ns
clojure.core

type
function

(first coll)

Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil.

                (first '(:alpha :bravo :charlie))
;;=> :alpha
            
                ;; nil is a valid (but empty) collection.
(first nil)
;;=> nil

;; if collection is empty, returns nil.
(first [])
;;=> nil
            
                => (first [1 2])
1

=> (first [ [1 2] [3 4] ])
[1 2]