JanetDocsPlaygroundI'm feeling luckyGitHub sign in

or



    macro
    boot.janet on line 293, column 1

    (or & forms)

    Evaluates to the last argument if all preceding elements are 
    falsey, otherwise evaluates to the first truthy element.


See also:bor1 exampleSign in to add an example
Loading...
(or true)        # => true
(or true true)   # => true
(or true false)  # => true

(or false 1 2)  # => 1
(or false 2 1)  # => 2

(or false nil)  # => nil
(or nil false)  # => false

# note that `or` does not behave as you might expect
# when used with `apply` and `splice`:
(or 1 2 3)             # => 1
(or (splice [1 2 3]))  # => (1 2 3)
(apply or [1 2 3])     # => (if 1 1 (if 2 2 3))
cellularmitosisPlayground