SplitScript reference / Language / fn

fn

declaration

fn name(parameters) { ... }

Declares a function or method.

Parameter and result annotations are optional when constraints from the body and call sites determine them.

Examples

Declare a helper

fn isBoss(level) {
    return level == 7
}