JanetDocsI'm feeling luckyGithub sign in

case



    macro
    boot.janet on line 189, column 1

    (case dispatch & pairs)
    
    Select the body that equals the dispatch value. When pairs has an odd
    number of arguments, the last is the default expression. If no match is
    found, returns nil.


1 exampleSign in to add an example
Loading...
(defn output [x]
  (case x
    :a "a"
    "b"))

(output :a) # => "a"
(output "anything else") # => "b"
swlkr