---
title: "Discussion on \"Falsy Values and how to Handle them with Logical OR and Nullish Coalescing\" | Hashnode"
description: "Discussion on \"Falsy Values and how to Handle them with Logical OR and Nullish Coalescing\". Let's crack the egg!!\n\nFirst, let's understand the OG - Logical OR (| |)\nLogical OR operator (||) is used to set a default value for a variable in case it is \"falsy\" (i.e., evaluates to false, null, undefined, 0, NaN, or an empty string).\nIf the firs..."
url: "https://hashnode.com/posts/falsy-values-and-how-to-handle-them-with-logical-or-and-nullish-coalescing/63f6a9f1a4cb5a56220025cd"
---

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

Discussion

# [Falsy Values and how to Handle them with Logical OR and Nullish Coalescing](https://shushma.hashnode.dev/falsy-values-and-how-to-handle-them-with-logical-or-and-nullish-coalescing?utm_source=hashnode&utm_medium=feed)

Let's crack the egg!! First, let's understand the OG - Logical OR (| |) Logical OR operator (||) is used to set a default value for a variable in case it is "falsy" (i.e., evaluates to false, null, undefined, 0, NaN, or an empty string). If the firs...

Feb 22, 2023 · 1 min read · shushma.hashnode.dev  
Read the article

-   [#nullish-coalescing](https://hashnode.com/tag/nullish-coalescing)
-   [#logical-operator](https://hashnode.com/tag/logical-operator)

## Written by

[Shushma Muniraj](https://hashnode.com/@Shushma)

@Shushma

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

The web is my playing field

## Responses 1

Markdown supported · ⌘↵ to post

[Anand Baraik](https://hashnode.com/@anandbaraik)

[Feb 23, 2023](https://hashnode.com/posts/falsy-values-and-how-to-handle-them-with-logical-or-and-nullish-coalescing/63f6a9f1a4cb5a56220025cd/comment/63f6bc6b437bc8d091bd1679)

Short & crisp 👏 well written!
