---
title: "Discussion on \"Add Only Truthy Values to Object\" | Hashnode"
description: "Discussion on \"Add Only Truthy Values to Object\". Add To Object Dynamically\nI believe you have come across a situation where you have to make sure\nyou only get the truthy value of a variable that simply means you have to\ncheck for all the falsy values in JavaScript like false, 0, -0, 0n, \"\", null, \n..."
url: "https://hashnode.com/posts/add-only-truthy-values-to-object/62083dedd59187113c4c12d4"
---

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

Discussion

# [Add Only Truthy Values to Object](https://ksr.hashnode.dev/add-only-truthy-values-to-object?utm_source=hashnode&utm_medium=feed)

Add To Object Dynamically I believe you have come across a situation where you have to make sure you only get the truthy value of a variable that simply means you have to check for all the falsy values in JavaScript like false, 0, -0, 0n, "", null, ...

Feb 12, 2022 · 2 min read · ksr.hashnode.dev  
Updated Feb 25, 2022  
Read the article

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

## Written by

[Kuldeep Rathore](https://hashnode.com/@kuldeepsingh)

@kuldeepsingh

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

I'm passionate about Web development. I can learn things quickly and can be productive at the same time. I can also be of great help when it comes to ideating and showing creativity. I am seeking a new opportunity to improve my skills.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
