Javascript undefined vs null
Today I am going to talk about the difference between javascript’s two of most famous primitive values, undefined and its counterpart null. Let's explore together what the differences are between null and undefined. Null The value null represents the intentional absence of any object value. Null must be assigned. An interesting thing about null is that it expresses a lack of identification, indicating that the variable points to no object. Undefined A variable that has not been assigned a value is of type undefined. A method or statement returns undefined if the evaluating variable does not have an assigned value A function returns undefined if a value is not returned Analogy To Understand : A metaphor or example scenario will help us to understand the underlying concept more thoroughly. Let's imagine that you need to fill up an important form of some kind. You are also handed the same form which is being already filled to help you out....