---
title: "Discussion on \"null vs undefined in JavaScript: Differences, Checks and When to Use Each (Tested Examples)\" | Hashnode"
description: "Discussion on \"null vs undefined in JavaScript: Differences, Checks and When to Use Each (Tested Examples)\". undefined means a value was never assigned (missing property, missing argument, bare return). null is an intentional empty value you assign yourself. Prefer === when you care which one you have, use ="
url: "https://hashnode.com/posts/javascript-null-vs-undefined/6af1fa81aab866a35fd040f7"
---

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

Discussion

# [null vs undefined in JavaScript: Differences, Checks and When to Use Each (Tested Examples)](https://mfaysaldev.hashnode.dev/javascript-null-vs-undefined?utm_source=hashnode&utm_medium=feed)

undefined means a value was never assigned (missing property, missing argument, bare return). null is an intentional empty value you assign yourself. Prefer === when you care which one you have, use =

18h ago · 12 min read · mfaysaldev.hashnode.dev  
Read the article

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

## Written by

[Mahir Faysal](https://hashnode.com/@mfaysaldev)

@mfaysaldev

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

Student web developer — PHP, JavaScript, Next.js

I write practical coding tutorials at https://mfaysal.com | Learning cybersecurity on TryHackMe: https://tryhackme.com/p/mfaysal.dev

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
