constantly

functionsince v0.0-927 clojure.core/constantlyEdit
(constantly x)

Details:

Returns a function that takes any number of arguments and always returns x.


Examples:

(def ten (constantly 10))

(ten "hi")
;;=> 10

(ten 123)
;;=> 10

(ten :whatever)
;;=> 10

See Also:


Source docstring:
Returns a function that takes any number of arguments and returns x.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn constantly
  [x] (fn [& args] x))