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

13 lines
271 B
JavaScript

//! This script defines a function with many parameters.
const KEY = 38;
fn f(a, b, c, d, e, f) {
let x = global::KEY; // <- access global module
a - b * c - d * e - f + x
}
let result = f(100, 5, 2, 9, 6, 32);
print(`result should be 42: ${result}`);