Function: -take

-take is a byte-compiled function defined in dash.el.

Signature

(-take N LIST)

Documentation

Return a copy of the first N items in LIST.

Return a copy of LIST if it contains N items or fewer. Return nil if N is zero or less.

See also: -take-last.

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -take (n list)
  "Return a copy of the first N items in LIST.
Return a copy of LIST if it contains N items or fewer.
Return nil if N is zero or less.

See also: `-take-last'."
  (declare (side-effect-free t))
  (static-if (fboundp 'dash--take)
      (dash--take n list)
    (--take-while (< it-index n) list)))