take-last

added
1.1

ns
clojure.core

type
function

(take-last n coll)

Returns a seq of the last n items in coll.  Depending on the type
of coll may be no better than linear time.  For vectors, see also subvec.

                user=> (take-last 2 [1 2 3 4])
(3 4)

user=> (take-last 2 [4])
(4)

user=> (take-last 2 [])
nil

user=> (take-last 2 nil)
nil

user=> (take-last 0 [1])
nil

user=> (take-last -1 [1])
nil