The ternary operator is a simplified conditional operator like if
/ else
.
Syntax: condition ? <expression if true> : <expression if false>
Here is an example using if
/ else
:
Here is the same example using a ternary operator:
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!