IBM interview question

What is the difference between null and undefined in JavaScript?

Interview Answer

Anonymous

4 June 2024

null represents an intentional absence of any value, while undefined indicates that a variable has been declared but hasn’t been assigned any value. null is a value that can be explicitly assigned, whereas undefined is the default value for uninitialized variables.