Skip to main content
Version: 1.0.2

is.false

is.false(target: unknown)โ€‹

is.false is a method that takes a single argument and returns a boolean value indicating whether the argument is false or not. If the argument is exactly equal to false, the method returns true. Otherwise, it returns false.

In this example, is.false is used to check whether various values are equal to false. The method returns true only for the first argument, which is exactly equal to false.

Note that is.false only checks for strict equality with false. It will return false for any other value, including null, undefined, 0, NaN, and the empty string ''.

Overall, is.false is a simple and useful method for checking whether a value is false.

Specificationโ€‹

  • Target argument: required.
  • Checks if the given "target" type is false.

Informationโ€‹

  • Unit tests: โœ…

Examplesโ€‹

is.false(false) // true
is.false(new Boolean(0)) // true
is.false(new Boolean()) // true

is.false(true) // false
is.false(new Boolean(1)) // false
is.false(new Boolean(-1)) // false
is.false(0) // false
is.false('') // false
is.false({}) // false
is.false([]) // false
// And all other known types will return false

Reversal boolean resultโ€‹

is.not.false(false) // false
is.not.false(new Boolean(0)) // false
is.not.false(new Boolean()) // false

is.not.false(true) // true
is.not.false(new Boolean(1)) // true
is.not.false(new Boolean(-1)) // true
is.not.false(0) // true
is.not.false('') // true
is.not.false({}) // true
is.not.false([]) // true
// And all other known types will return true