Try*_*ace 3 javascript refactoring shorthand-if ternary-operator shorthand
我想实现这个目标:
if (full) {
return
}
else{
// nuthin
}
Run Code Online (Sandbox Code Playgroud)
但更短一些,比如:
full ? return : null;
Run Code Online (Sandbox Code Playgroud)
但这不起作用..
我可以做:
if (full) { return }
Run Code Online (Sandbox Code Playgroud)
但我更喜欢三元
我期待类似的full ? return
工作......
我基本上想在值为 true 时突破当前函数...是否有更好/有效的速记可用?
归档时间: |
|
查看次数: |
4715 次 |
最近记录: |