Fundamentals6 / 11
Up next

if and when

;; if is an expression that returns a value
(def n 7)
(println (if (even? n) "even" "odd"))
;; when runs its body only when the test is truthy
(when (pos? n)
  (println "positive"))
What you're solving

branching expressions