Examples · learn/03-functions · 87 of 339
return
tin run examples/learn/03-functions/return.tinfn describe(n: int): string {
if n < 0 { return "negative" } // return leaves the function early
if n == 0 { return "zero" }
"positive"
}
fn main() {
print(describe(-4))
print(describe(0))
print(describe(9))
}