3 ms·
If you have a function that's using if statements to decide which boolean to return, it's almost always better to return the expression directly. `if (foo) {
by pythonaut_16 8y ago
If you have a function that's using if statements to decide which boolean to return, it's almost always better to return the expression directly.
`if (foo) {
return true
} else {
return false
}`
is the same as `return boolean(foo)`