Sollicitatievraag bij IBM

What is the difference between null and undefined in JavaScript?

Antwoord op sollicitatievraag

Anoniem

4 jun 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.