---
title: "Comment by Josh Martin on \"Which one to Use Ternary Operator or If-Else Block\" | Hashnode"
description: "I had no idea this was a thing. I can already think of areas I could apply this to and it&#39;s so much quicker than an if else!"
url: "https://hashnode.com/posts/which-one-to-use-ternary-operator-or-if-else-block/5fdba963b78ac62dff80a34c/comment/5fdbfea9b78ac62dff80a7ea"
---

[Discussion](https://hashnode.com/posts/which-one-to-use-ternary-operator-or-if-else-block/5fdba963b78ac62dff80a34c)

Comment [Which one to Use Ternary Operator or If-Else Block](https://hashnode.com/posts/which-one-to-use-ternary-operator-or-if-else-block/5fdba963b78ac62dff80a34c)

[Josh Martin](https://hashnode.com/@joshmartindev)

[Dec 18, 2020](https://hashnode.com/posts/which-one-to-use-ternary-operator-or-if-else-block/5fdba963b78ac62dff80a34c/comment/5fdbfea9b78ac62dff80a7ea)

I had no idea this was a thing. I can already think of areas I could apply this to and it's so much quicker than an if else!

[VISWAPRASATH KS](https://hashnode.com/@HeyVP7)

[Dec 18, 2020](https://hashnode.com/posts/which-one-to-use-ternary-operator-or-if-else-block/5fdba963b78ac62dff80a34c/comment/5fdbfea9b78ac62dff80a7ea#reply-5fdc0b441485f22e24b32b35)

Was randomly poking one of my friend about this question. And got to learn we miss it so quickly. Few years back I was nudged by my friend by same question. Hope you will remember this article in future while working.
