DEV Community

 Bishnu Prasad Chowdhury
Bishnu Prasad Chowdhury

Posted on • Edited on

Javascript not defined vs undefined

undefined example:

console.log(a) 
// memory reserved for a
var a = 5;
console.log(a)
Enter fullscreen mode Exit fullscreen mode

Output:
undefined
5

Not defined example:

console.log(b)
// No memory is reserved
Enter fullscreen mode Exit fullscreen mode

Output:

Uncaught reference error: b is not defined

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay