Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

假值与真值 #12

Open
Qhappyman opened this issue Jun 16, 2019 · 0 comments
Open

假值与真值 #12

Qhappyman opened this issue Jun 16, 2019 · 0 comments

Comments

@Qhappyman
Copy link
Owner

Qhappyman commented Jun 16, 2019

js中的每个值都有固定的布尔值,在布尔值表达式中评估该值时,该值就会转化为固定的布尔值,如果布尔值为true,那么为真值,如果为false,那么为假值。

js中假值:

  • false
  • null
  • undefined
  • 0
  • NaN
  • ""
    也就是
Boolean(false)=false
Boolean(null)=false

其余几乎为真值,就这样

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant