assert
Verifies that a condition is true.
Syntax
-
assert(b[, s])
-
b
is a boolean -
s
is a string
-
Description
If b
is true
, then assert(b, s)
returns null
; otherwise, assert(b, s)
raises an error with message s
.
Examples
assert(n > 0, "n must be positive")
failure
n must be positive
Call stack: assert