代码如下:
if (foo) bar();else baz(); ==> foo? bar(): baz();
if (!foo) bar();else baz(); ==> foo? baz(): bar();
if (foo) return bar();else return baz(); ==> return foo? bar(): baz();
代码如下:
if (foo) bar(); ==> foo && bar();
if (!foo) bar(); ==> foo || bar();
代码如下:
if (foo) return bar(); else other(); ==> {if (foo) return bar();other()}