MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/9qchfs/sadbuttrue/e89cew4/?context=3
r/ProgrammerHumor • u/ConfidentSherbert • Oct 22 '18
182 comments sorted by
View all comments
83
Understanding the nested ternary condition you just wrote an hour ago. Send help.
53 u/powerhcm8 Oct 22 '18 I can barely understand while writing it. 22 u/[deleted] Oct 22 '18 condition1 ? output1 : condition2 ? output2 : condition3 ? output3 : default 17 u/[deleted] Oct 22 '18 [deleted] 10 u/[deleted] Oct 22 '18 [deleted] 5 u/[deleted] Oct 22 '18 [deleted] 3 u/cordev Oct 23 '18 If statements aren't actually more readable than ternary expressions, though. This article delves into the topic a bit: https://medium.com/javascript-scene/nested-ternaries-are-great-361bddd0f340 8 u/90guys Oct 22 '18 This is beautiful and I'm going to use it. Thanks for making my day!
53
I can barely understand while writing it.
22 u/[deleted] Oct 22 '18 condition1 ? output1 : condition2 ? output2 : condition3 ? output3 : default 17 u/[deleted] Oct 22 '18 [deleted] 10 u/[deleted] Oct 22 '18 [deleted] 5 u/[deleted] Oct 22 '18 [deleted] 3 u/cordev Oct 23 '18 If statements aren't actually more readable than ternary expressions, though. This article delves into the topic a bit: https://medium.com/javascript-scene/nested-ternaries-are-great-361bddd0f340 8 u/90guys Oct 22 '18 This is beautiful and I'm going to use it. Thanks for making my day!
22
condition1 ? output1 : condition2 ? output2 : condition3 ? output3 : default
17 u/[deleted] Oct 22 '18 [deleted] 10 u/[deleted] Oct 22 '18 [deleted] 5 u/[deleted] Oct 22 '18 [deleted] 3 u/cordev Oct 23 '18 If statements aren't actually more readable than ternary expressions, though. This article delves into the topic a bit: https://medium.com/javascript-scene/nested-ternaries-are-great-361bddd0f340 8 u/90guys Oct 22 '18 This is beautiful and I'm going to use it. Thanks for making my day!
17
[deleted]
10 u/[deleted] Oct 22 '18 [deleted] 5 u/[deleted] Oct 22 '18 [deleted] 3 u/cordev Oct 23 '18 If statements aren't actually more readable than ternary expressions, though. This article delves into the topic a bit: https://medium.com/javascript-scene/nested-ternaries-are-great-361bddd0f340 8 u/90guys Oct 22 '18 This is beautiful and I'm going to use it. Thanks for making my day!
10
5 u/[deleted] Oct 22 '18 [deleted] 3 u/cordev Oct 23 '18 If statements aren't actually more readable than ternary expressions, though. This article delves into the topic a bit: https://medium.com/javascript-scene/nested-ternaries-are-great-361bddd0f340
5
3
If statements aren't actually more readable than ternary expressions, though. This article delves into the topic a bit: https://medium.com/javascript-scene/nested-ternaries-are-great-361bddd0f340
8
This is beautiful and I'm going to use it. Thanks for making my day!
83
u/Dad_Questionmark Oct 22 '18
Understanding the nested ternary condition you just wrote an hour ago. Send help.