The value converted to false in Js

Values ​​in JavaScript can be divided into the following two categories:

  1. A value that can be coerced to false
  2. Other (values ​​cast to true) The
    JavaScript specification specifically defines a small set of values ​​that can be cast to false.
    The abstract operation ToBoolean is defined in section 9.2 of the ES5 specification, enumerating all possible
    outcomes .
    These are falsy values:
    • undefined
    • null
    • false
    • +0 , -0 and NaN
    • Boolean coercion of ""
    falsy value results in false .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325504089&siteId=291194637