---
title: "Discussion on \"Nullish Coalescing Operator (??)\" | Hashnode"
description: "Discussion on \"Nullish Coalescing Operator (??)\". Nullish coalescing operator is a logical operator. It returns right hand operand only if left hand operand is null or undefined. \nSyntax\nleftOperand ?? rightOperand\nExamples:\nconst user = null ?? \"user\";\nconsole.log(user);\n/* output:  user  */\n\nconst..."
url: "https://hashnode.com/posts/nullish-coalescing-operator/61dc8368b0c3ca3df9b4a19b"
---

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

Discussion

# [Nullish Coalescing Operator (??)](https://sririshi.hashnode.dev/nullish-coalescing-operator?utm_source=hashnode&utm_medium=feed)

Nullish coalescing operator is a logical operator. It returns right hand operand only if left hand operand is null or undefined. Syntax leftOperand ?? rightOperand Examples: const user = null ?? "user"; console.log(user); /\* output: user \*/ const...

Jan 10, 2022 · 1 min read · sririshi.hashnode.dev  
Read the article

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

## Written by

[Rishi Srivastava](https://hashnode.com/@sririshi)

@sririshi

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

Front end developer

## Responses 1

Markdown supported · ⌘↵ to post

[Ruchi Goswami](https://hashnode.com/@RuchiGoswami)

[Jan 11, 2022](https://hashnode.com/posts/nullish-coalescing-operator/61dc8368b0c3ca3df9b4a19b/comment/61dcececcda0d0294b69c5fe)

Good examples :)

[Rishi Srivastava](https://hashnode.com/@sririshi)

[Jan 11, 2022](https://hashnode.com/posts/nullish-coalescing-operator/61dc8368b0c3ca3df9b4a19b/comment/61dcececcda0d0294b69c5fe#reply-61dd83686226ab4f74bef54e)

Thanks Ruchi
