---
title: "Discussion on \"Ternary operators in JavaScript\" | Hashnode"
description: "Discussion on \"Ternary operators in JavaScript\". Ternary operators are also known as conditional operators. Basically, they put an if else statement onto one line.\nWith these examples I've put them in a codepen, to make them easy to test. Feel free to use it to have a play. In the HTML I just have ..."
url: "https://hashnode.com/posts/ternary-operators-in-javascript/61b5eb4e0059f90a57a55909"
---

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

Discussion

# [Ternary operators in JavaScript](https://blog.nicm42.me.uk/ternary-operators-in-javascript?utm_source=hashnode&utm_medium=feed)

Ternary operators are also known as conditional operators. Basically, they put an if else statement onto one line. With these examples I've put them in a codepen, to make them easy to test. Feel free to use it to have a play. In the HTML I just have ...

Dec 12, 2021 · 4 min read · blog.nicm42.me.uk  
Read the article

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

## Written by

[Nic](https://hashnode.com/@nicm42)

@nicm42 · England

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

This week I learnt...

Front End Developer. I like problem solving and making things pretty. I also like red.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
