---
title: "Comment by Heaust on \"If-Else or Switch-Case: Which One to Pick?\" | Hashnode"
description: "Awesome Breakdown! I once stumbled upon this weird way of doing switch case-y things { &quot;Condition 1&quot; : &quot;Result 1&quot; , &quot;Condition 2&quot;"
url: "https://hashnode.com/posts/if-else-or-switch-case-which-one-to-pick/618b4475468c06249afc5858/comment/618b8846468c06249afc5e6e"
---

[Discussion](https://hashnode.com/posts/if-else-or-switch-case-which-one-to-pick/618b4475468c06249afc5858)

Comment [If-Else or Switch-Case: Which One to Pick?](https://hashnode.com/posts/if-else-or-switch-case-which-one-to-pick/618b4475468c06249afc5858)

[Heaust](https://hashnode.com/@heaust)

[Nov 10, 2021](https://hashnode.com/posts/if-else-or-switch-case-which-one-to-pick/618b4475468c06249afc5858/comment/618b8846468c06249afc5e6e)

Awesome Breakdown!

I once stumbled upon this weird way of doing switch case-y things

```
{
"Condition 1": "Result 1",
"Condition 2": "Result 2"
}[query]
```

Now I always try to do this as a meme xD

[Sumudu Siriwardana](https://hashnode.com/@sumudusiriwardana)

[Nov 10, 2021](https://hashnode.com/posts/if-else-or-switch-case-which-one-to-pick/618b4475468c06249afc5858/comment/618b8846468c06249afc5e6e#reply-618bb510468c06249afc62a6)

This is weird.. I need to check this 😂
