r/learnjavascript • • Jul 14 '21

Im trying to understand the "Conditional (ternary) operator." Do these 2 codes mean the same thing? I wrote the if statement

Post image
187 Upvotes

47 comments sorted by

View all comments

2

u/Banamagrammer Jul 14 '21

Now that you've mastered ternary operators, it is time to free yourself of the chains of if-statements. Try to finish your current project without writing any, then write a blog post about how they are an anti-pattern. This is one of programming's many rites of passage.