Skip to main content

true

The true keyword is the Boolean true literal. It is a value of type bool representing a truthy condition.


Syntax & Example

let active: bool = true;
let ready = true;

if ready {
print("ready");
}

Use Cases

  • Initializing Boolean flags and options.
  • Returning a Boolean result from a function or expression.
  • Serving as the truthy branch condition in if/while tests.