---
title: "Discussion on \"Dump the if-else, use these short-hand techniques instead.\" | Hashnode"
description: "Discussion on \"Dump the if-else, use these short-hand techniques instead.\". Have you ever had to write a series of if-else statements and wondered if it could be shorter? Like the code block below, maybe you figured out how to use a shorthand statement but don't fully grasp the context of using them? Well, no need to fear, D..."
url: "https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb"
---

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

Discussion

# [Dump the if-else, use these short-hand techniques instead.](https://sublimedev.hashnode.dev/dump-the-if-else-use-these-short-hand-techniques-instead?utm_source=hashnode&utm_medium=feed)

Have you ever had to write a series of if-else statements and wondered if it could be shorter? Like the code block below, maybe you figured out how to use a shorthand statement but don't fully grasp the context of using them? Well, no need to fear, D...

Apr 27, 2020 · sublimedev.hashnode.dev  
Updated Apr 29, 2020  
Read the article

-   [#coding](https://hashnode.com/tag/coding)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#hack](https://hashnode.com/tag/hack)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#programming-ciovqvfcb008mb253jrczo9ye](https://hashnode.com/tag/programming-ciovqvfcb008mb253jrczo9ye)

## Written by

[David Ayoola](https://hashnode.com/@david_ayo)

@david\_ayo · 🌍

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

Software/web engineer

I'm an awesome software creator, design enthusiast and sublime text user 🕴🏽🧙🏽‍♂️

## Responses 4

Markdown supported · ⌘↵ to post

[Osinachi Chukwujama](https://hashnode.com/@Vicradon)

[Apr 28, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea8c26ee15f06fa46eede81)

Great tips man. You're doing well.

Though, the lookup table. The final console.log gets executed regardless of the presence of the key in the table.

[David Ayoola](https://hashnode.com/@david_ayo)

[Apr 29, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea8c26ee15f06fa46eede81#reply-5ea95492f068bba9527d967a)

Thanks, Victor, I've updated it to use ternary operators instead 🙏🏽

[Ronak](https://hashnode.com/@ronakmistry)

[Apr 28, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea828b8927cd8e125d847e5)

Awesome tips : ) we can also use [ramdajs](https://ramdajs.com/) for some cases as well.

[David Ayoola](https://hashnode.com/@david_ayo)

[Apr 28, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea828b8927cd8e125d847e5#reply-5ea82dea927cd8e125d847f3)

Thank you, Ronak, and thanks for the link, checking out Ramda's cookbook as we speak 🙏🏽

[Leon Chux](https://hashnode.com/@morpheus)

[Apr 28, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea82489927cd8e125d847d6)

Well written piece 👌👌

[David Ayoola](https://hashnode.com/@david_ayo)

[Apr 28, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea82489927cd8e125d847d6#reply-5ea828f3927cd8e125d847ed)

Thank you !!

[Nesha Zoric](https://hashnode.com/@kolosek)

[Apr 27, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea6ef180135fc4176630621)

Thanks for the tip!

[David Ayoola](https://hashnode.com/@david_ayo)

[Apr 27, 2020](https://hashnode.com/posts/dump-the-if-else-use-these-short-hand-techniques-instead/5ea5f8830135fc417662fbeb/comment/5ea6ef180135fc4176630621#reply-5ea6fabf12892a3c760b9aa6)

You're welcome Nesha!
