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

几个步骤记住&&和||的结果 #45

Open
lovelmh13 opened this issue Aug 15, 2020 · 0 comments
Open

几个步骤记住&&和||的结果 #45

lovelmh13 opened this issue Aug 15, 2020 · 0 comments

Comments

@lovelmh13
Copy link
Owner

  1. 看先运算符左边的,对左边的值进行条件判断,不是布尔值强制转换成布尔值
  2. 左边的值为true时,&&返回后面的,||返回前面的
  3. 左边的值false是,&&返回前面的,||返回后面的

类似于:

a||b ----->  a ? a : b

a&&b -----> a ? b : a
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