What is the difference between `null` and `undefined` in JavaScript?

JavaScript Professional Easy

JavaScript Professional — Easy

What is the difference between `null` and `undefined` in JavaScript?

Key points

  • Developers intentionally assign null as a value
  • Undefined signifies a variable without a value assignment
  • Knowing the difference helps in debugging code
  • Null and undefined are not interchangeable

Ready to go further?

Related questions