rhai/scripts/if2.rhai
2022-07-24 23:03:35 +08:00

13 lines
184 B
JavaScript

//! This script runs an if expression.
let a = 42;
let b = 123;
let x = if a <= b { // <- if-expression
b - a
} else {
a - b
} * 10;
print(`x should be 810: ${x}`);