---
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 to use if-else vs Switch-statement?"
url: "https://hashnode.com/posts/control-flow-in-js/699e82a30daf99859e691a84"
---

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

Discussion

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

when to use if-else vs Switch-statement?

Feb 25 · 5 min read · nm-javascript.hashnode.dev  
Read the article

-   [#control-flow](https://hashnode.com/tag/control-flow)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#if-else](https://hashnode.com/tag/if-else)
-   [#else-if](https://hashnode.com/tag/else-if)
-   [#switch](https://hashnode.com/tag/switch)
-   [#logical-operator](https://hashnode.com/tag/logical-operator)
-   [#if-else-vs-switch](https://hashnode.com/tag/if-else-vs-switch)

## Written by

[Nikhil Mali](https://hashnode.com/@nikhilsdf)

@nikhilsdf

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

nik

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
