falsy

adj

falsy

adj

Etymology From false + -y, to be an antonym to truthy.

1

Computing, Engineering, Mathematics, Natural sciences, Physical sciences, Programming, Sciences Evaluating to false in a Boolean context.

  • In JavaScript, any expression or statement that expects a boolean value will work with a truthy or falsy value, so the fact that && does not always evaluate to true or false does not cause practical problems.2012, David Flanagan, JavaScript Pocket Reference, page 40:
  • However, in the second case, both '0' and the empty string () are falsy (in other words, they behave like false) and are therefore equal with respect to ==.2014, Basarat Syed, Beginning Node.js, →ISBN, page 33:
1 more example
  • If the first operand (which comes before the question mark--doIt, in this example) is truthy, the expression evaluates to the second operand (between the question mark and colon), and if it's falsy, it evaluates to the third operand (after the colon).2016, Kenny Ballou, Learning Elixir, →ISBN, page 92:
Derived terms
falsiness

Entry derived from the Wiktionary, under licence CC BY-SA 4.0 — list of authors.