In some languages (e.g. C), the boolean values are defined as actual numerical values, so they are just different names for

1 and 0 (or -1 and 0).

  In some other languages (e.g.  Java),treats boolean as a completely separate data type which has 2 distinct values: true and false.

The values 1 and 0 are of type int and are not implicitly convertible to boolean.

  Javascript falls in the category that has a distinct boolean type, but on the other hand Javascript is quite keen to convert values

between different data types.

相关文章:

  • 2021-12-12
  • 2022-02-28
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
猜你喜欢
  • 2021-06-13
  • 2021-06-23
  • 2019-12-21
  • 2021-07-03
  • 2021-07-16
  • 2022-12-23
相关资源
相似解决方案