Community Picks
Read post

What is the difference between statement and statement in JavaScript?

Learn the main difference between if...else and ternary operator in JavaScript. Understand why the ternary operator is considered an expression and if...else is considered a statement. Discover why if...else cannot be used directly in JSX in a React app.

    #javascript#react#jsx
Apr 19, 2024•4m read time•From kumarshivesh1.hashnode.dev
Post cover image
Table of contents
Permalink IntroductionPermalink if...else statementPermalink Ternary OperatorPermalink Reason why if...else and ternary operator are NOT the exactly same?
117 Impressions2 Comments
Community Picks's image
Community Picks

Community Picks is a section on daily.dev where our community members share the most interesting and...

9.9K Followers

•

336.5K Upvotes

priyankarpal's user avatar
Priyankar Pal
@priyankarpal
Joined Dec 10. 2022
3.3K

working on backend engg.

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard