Skip to main content

is_truthy

Function is_truthy 

Source
pub fn is_truthy(v: &Value) -> bool
Expand description

Check if a Value is truthy (for boolean contexts).

  • true → true, false → false
  • Null → false
  • Numbers: non-zero → true
  • Strings: non-empty → true
  • Arrays/Objects: always true