Front End Developer (AngularJS) Question: Download Questions PDF
Explain difference between null and undefined?
![Front End Developer (AngularJS) Interview Answer Front End Developer (AngularJS) Interview Question](https://globalguideline.com/public/images/interview/4.png)
Answer:
This can be tricky and the best way to keep in your head is to memorise because if you try to relate javascript null to other languages, it will get more confusing.
In javascript, null is an object with no value and undefined is a type.
typeof null; // "object"
typeof undefined; // "undefined"
var a;
var b = null;
a == b; // "true" because their values are the same
a === b; // "false". they have different types
In javascript, null is an object with no value and undefined is a type.
typeof null; // "object"
typeof undefined; // "undefined"
var a;
var b = null;
a == b; // "true" because their values are the same
a === b; // "false". they have different types
Download Front End Developer (AngularJS) Interview Questions And Answers
PDF