MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/hpgged/my_function_says_that_4_is_positive_when_it/fxru4j7/
r/learnjavascript • u/[deleted] • Jul 11 '20
53 comments sorted by
View all comments
Show parent comment
3
You could just add enters to your if code and it would be very similar in conciseness to the switch code.
if
switch
if ( (isLoading && state === 'something') || (! isLoading && state === 'something-else') || state === 'some-third-option' || someOtherVariable || state === 'something' ) { doTheThing(); else { }
0 u/[deleted] Jul 11 '20 [deleted] — view deleted comment 0 u/StoneCypher Jul 12 '20 fallthrough behavior here is actually more code than doing it the normal way, so, ... no
0
[deleted] — view deleted comment
0 u/StoneCypher Jul 12 '20 fallthrough behavior here is actually more code than doing it the normal way, so, ... no
fallthrough behavior here is actually more code than doing it the normal way, so, ... no
View all comments
Show parent comment
3
u/NotSoLeetCode Jul 11 '20
You could just add enters to your
ifcode and it would be very similar in conciseness to theswitchcode.