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

[js] 141.什么是三元表达式?“三元”表示什么意思? #310

Open
qiilee opened this issue Oct 3, 2019 · 1 comment
Open
Labels

Comments

@qiilee
Copy link
Member

qiilee commented Oct 3, 2019

No description provided.

@qiilee qiilee added the JS label Oct 3, 2019
@asdf-wq
Copy link

asdf-wq commented Oct 25, 2019

(express1) ? (express2) : (express3)
 在 express1求值为 true 时的值为 express2,在express1求值是 false 时的值为 express1
举个栗子:if(a>0){
console.log(真好看)
}
else{
console.log(真漂亮)
}
a>0 ? 真好看:真漂亮 (判断条件a>0吗,问一下,大于就是真好看,反之真漂亮)

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

No branches or pull requests

2 participants