---
title: "Discussion on \"Ternary Operator in JavaScript\" | Hashnode"
description: "Discussion on \"Ternary Operator in JavaScript\". The ternary operator is used when there are two possible outcomes of any condition i.e. true or false. We assign two codes to the operator, one for the condition if it is true and another for the condition if it is false.\nThis operator contains a que..."
url: "https://hashnode.com/posts/ternary-operator-in-javascript/6374a5845891185003b538ad"
---

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

Discussion

# [Ternary Operator in JavaScript](https://prashanthandel.hashnode.dev/ternary-operator-in-javascript?utm_source=hashnode&utm_medium=feed)

The ternary operator is used when there are two possible outcomes of any condition i.e. true or false. We assign two codes to the operator, one for the condition if it is true and another for the condition if it is false. This operator contains a que...

Nov 16, 2022 · 2 min read · prashanthandel.hashnode.dev  
Updated Aug 7, 2023  
Read the article

-   [#ternary-operator](https://hashnode.com/tag/ternary-operator)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Prashant Handel](https://hashnode.com/@prashanthandel)

@prashanthandel · Indore, India

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

Frontend Developer

I'm a self taught web developer and a learner as well. I am sharing my experiences and knowledge here with a hope to help those who are beginners as sharing helps to grow together.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
