---
title: "Discussion on \"Control Flow in JavaScript: If, Else, and Switch Explained\" | Hashnode"
description: "Discussion on \"Control Flow in JavaScript: If, Else, and Switch Explained\". When you write JavaScript, your code doesn’t always run top to bottom in one straight line.\nSometimes the program needs to make decisions:\n\nShould this code run?\n\nShould another block run instead?\n\nWh"
url: "https://hashnode.com/posts/control-flow-in-javascript-if-else-and-switch-explained/69b4393f6e27dd07d921b52f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Control Flow in JavaScript: If, Else, and Switch Explained](https://js-basics-series.hashnode.dev/control-flow-in-javascript-if-else-and-switch-explained?utm_source=hashnode&utm_medium=feed)

When you write JavaScript, your code doesn’t always run top to bottom in one straight line. Sometimes the program needs to make decisions: Should this code run? Should another block run instead? Wh

Mar 13 · 8 min read · js-basics-series.hashnode.dev  
Read the article

-   [#js-control-statement](https://hashnode.com/tag/js-control-statement)
-   [#if-else](https://hashnode.com/tag/if-else)
-   [#if-else-in-js](https://hashnode.com/tag/if-else-in-js)
-   [#switch](https://hashnode.com/tag/switch)
-   [#switch-case](https://hashnode.com/tag/switch-case)
-   [#hiteshchoudharylco](https://hashnode.com/tag/hiteshchoudharylco)
-   [#chaiaurcode](https://hashnode.com/tag/chaiaurcode)
-   [#types-of-control-flow](https://hashnode.com/tag/types-of-control-flow)

## Written by

[Ritu Sood](https://hashnode.com/@ritusood)

@ritusood

  
[View profile](https://hashnode.com/@ritusood)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
