<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/7IUA1UShO" -->

---
title: What is the ? operator in JavaScript? | daily.dev
description: Discussion about "What is the ? operator in JavaScript?" on daily.dev - join the developer community
canonical: https://daily.dev/posts/what-is-the-operator-in-javascript--7iua1usho
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What is the ? operator in JavaScript? | daily.dev
og:description: Discussion about "What is the ? operator in JavaScript?" on daily.dev - join the developer community
og:url: https://daily.dev/posts/what-is-the-operator-in-javascript--7iua1usho
og:image: https://api.daily.dev/og/posts/7IUA1UShO.png
og:image:alt: What is the ? operator in JavaScript?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What is the ? operator in JavaScript?

**[JavaScript in Plain English](https://daily.dev/sources/jsPlainEnglish)** · 3 min read · 4 upvotes · 2 comments

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/javascript-in-plain-english/use-of-operator-in-javascript-6a5c096ed246>

## Community discussion

Top comments from developers on daily.dev.

**@ssjones** · 1 upvotes

> Quick summation of the ? operator in js and its uses.

**@jpeavler** · 1 upvotes

> It gives precise usage of '?' in three different cases. I was only aware of its ternary operation.

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/what-is-the-operator-in-javascript--7iua1usho)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"What is the ? operator in JavaScript?","url":"https://daily.dev/posts/what-is-the-operator-in-javascript--7iua1usho","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-is-the-operator-in-javascript--7iua1usho"},"datePublished":"2021-01-25T18:35:44.995Z","dateModified":"2021-10-07T14:17:10.317Z","description":"Discussion about \"What is the ? operator in JavaScript?\" on daily.dev - join the developer community","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/56527cc467bc07209c6a5ee33768a813","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/56527cc467bc07209c6a5ee33768a813","isAccessibleForFree":true,"articleSection":"JavaScript in Plain English","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"JavaScript in Plain English","logo":"https://media.daily.dev/image/upload/s--Dg5QTRuI--/f_auto,q_auto/v1686665538/logos/pe","url":"https://daily.dev/sources/jsPlainEnglish"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/what-is-the-operator-in-javascript--7iua1usho","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"javascript","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JavaScript in Plain English","item":"https://daily.dev/sources/jsPlainEnglish"},{"@type":"ListItem","position":3,"name":"What is the ? operator in JavaScript?"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/what-is-the-operator-in-javascript--7iua1usho","comment":[{"@type":"Comment","text":"Quick summation of the ? operator in js and its uses.","datePublished":"2021-01-25T20:07:18.705Z","url":"https://daily.dev/posts/7IUA1UShO#c-N9Gl5e1tl","author":{"@type":"Person","name":"SS Jones","url":"https://daily.dev/ssjones","image":"https://avatars.githubusercontent.com/u/56704209?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"It gives precise usage of ‘?’ in three different cases. I was only aware of its ternary operation.","datePublished":"2021-01-25T21:19:57.966Z","url":"https://daily.dev/posts/7IUA1UShO#c-5pfMWJa3G","author":{"@type":"Person","name":"Joshua Peavler","url":"https://daily.dev/jpeavler","image":"https://avatars2.githubusercontent.com/u/61213124?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

