Assertions are a way of breaking out of code when there is an error or an unexpected input.

Some languages throw exceptions and some treat it as a break point.



Task

Show an assertion in your language by asserting that an integer variable is equal to 42.




require(a == 42)          # default message, "Required condition failed"
 
require(a == 42, "The Answer is Wrong.")   # supplied message
 
require(a == 42, fn { `Off by ${a - 42}.` })   # computed only on failure