last

functionsince v0.0-927 clojure.core/lastEdit
(last s)

Details:

Returns the last item in coll in linear time.

peek is much faster than last for a vector.


Examples:

(last [1 2 3])
;;=> 3

(last [1 2])
;;=> 2

(last [1])
;;=> 1

(last [])
;;=> nil

See Also:


Source docstring:
Return the last item in coll, in linear time
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn last
  [s]
  (let [sn (next s)]
    (if-not (nil? sn)
      (recur sn)
      (first s))))