---
title: "What is the difference between statement and statement in JavaScript?"
url: https://daily.dev/posts/what-is-the-difference-between-statement-and-statement-in-javascript--mujf5dyna
source_url: https://kumarshivesh1.hashnode.dev/what-is-the-difference-between-a-statement-and-an-expression-in-javascript
type: article
source: "Community Picks"
published: 2024-04-19T03:16:51.340Z
updated: 2024-05-09T09:03:00.647Z
tags: ["javascript", "react", "jsx"]
reading_time: 4
upvotes: 19
comments: 2
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What is the difference between statement and statement in JavaScript?

**[Community Picks](https://daily.dev/sources/community)** · 4 min read · 19 upvotes · 2 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://kumarshivesh1.hashnode.dev/what-is-the-difference-between-a-statement-and-an-expression-in-javascript>

## Community discussion

Top comments from developers on daily.dev.

**@merix** · 0 upvotes

> Great content!

**@annupkapur** · 0 upvotes

> This is a great article. Well written and clear.

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#react](https://daily.dev/tags/react), [#jsx](https://daily.dev/tags/jsx)

[View this post on daily.dev](https://daily.dev/posts/what-is-the-difference-between-statement-and-statement-in-javascript--mujf5dyna)
