Skip to content

return

Control flow

Leave the current function, optionally with a value.

return;
return expr;
NameTypeDescription
exprTMust match the function return type when present.

Ends the function.

return / return expr

void functions use return;. Multiple return values use destructuring on the caller side, not return a, b in current CL++ style — return a table or a single value.

const int DoubleCoins(int coins) {
return coins;
}

Emits:

const function DoubleCoins(coins: number): number
return coins
end

function · void · guard