+ 4
This is good👍👍. But this is only for one line if-else leader and it's easy to understand for only one line if-else leader. If you require some more big if-else or if-elseif-else leader than you must be use the typical way.
6th Mar 2022, 10:43 AM
jayrv_7_
+ 4
Whenever you see like: if(...) someBoolVar = true; or return true; you can be pretty certain it is a bad style. The expression "n % 2 != 0" is already boolean. You can assign directly: isPrime = ( n % 2 != 0 ); [The parentheses are not necessary. It is a matter of style if you prefer to have them or not.]
6th Mar 2022, 11:38 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 1
Welcome 👍👍👍
6th Mar 2022, 10:50 AM
jayrv_7_