In most JavaScript cases, evaluating variable is undefined, null, or NaN is very common. Their definition are shown below:
- undefined: a declared variable which is not assigned value.
- null: object value which means "no value".
- NaN: "Not-a-Number" value
References:
JavaScript Global Reference
- undefined: a declared variable which is not assigned value.
- null: object value which means "no value".
- NaN: "Not-a-Number" value
Example for checking "undefined"
Example for checking "null"
Example for checking "NaN"
References:
JavaScript Global Reference
Comments
Post a Comment