boolean

functionsince v0.0-927 clojure.core/booleanEdit
(boolean x)

Details:

Return false if x is false or nil. Otherwise return true. This is the truthiness condition used by if expressions.


Examples:

(boolean 1)
;;=> true

(boolean 0)
;;=> true

(boolean nil)
;;=> false

See Also:


Source docstring:
Coerce to boolean
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn ^boolean boolean
  [x]
  (cond
    (nil? x) false
    (false? x) false
    :else true))