Mwnci bool() Function

Syntax

bool(value)

Description

bool() converts value to a bool.

  • integer/float: Returns true for non-zero, false otherwise.
  • array/hash/string: Returns true if non-empty, false otherwise.
  • Boolean: Returns the value directly

Any other type or value will return false

Example

a="fred"
println(bool(a))

true