开发者

Alternative to if statement in this simple example

开发者 https://www.devze.com 2023-01-22 04:57 出处:网络
if(metres >= 0) return true; else return false; Can I开发者_如何转开发 do this with a single calculation? (ignoring the ternary operator)return (metres >= 0);
if(metres >= 0) return true;
else return false;

Can I开发者_如何转开发 do this with a single calculation? (ignoring the ternary operator)


return (metres >= 0);


return metres >= 0;
0

精彩评论

暂无评论...
验证码 换一张
取 消