Toggle navigation
Contractual
What?
Why?
How?
Try!
Use!
Github
codemix
Try Contractual
Syntactic sugar for Design by contract in JavaScript.
Input
function divide (a, b) { pre: typeof a === 'number'; typeof b === 'number'; b !== 0, 'May not divide by zero'; main: return a / b; post: __result < a; } alert(divide(10, 0));
Run
Output