The difference between undefined, null and NaN in Javascript

preview_player
Показать описание
This video covers falsey values, the identity operator and the isNaN function. I try to explain not just how Javascript behaves, but provide somewhat of a rationale for this behavior.

Summary:
undefined — The default value of a variable that has been declared but not assigned a value
null — A value meaning "nothing" or "no value" that is useful to assign to variables or return from functions
NaN — The result of an invalid mathematical operation, or failure to convert a non-numerical value to a number
equality operator (==) — Operator which does type conversion before comparison
identity operator (===) — Operator which does not do type conversion

#Javascript #Null #Programming

0:00 Introduction
00:10 Boolean Values
00:35 Falsey Values
01:11 Undefined Values
02:25 Null Values
03:29 Return Values
04:54 Undefined and Null from Functions
05:11 Not a Number
06:00 Empty Strings
06:51 Evaluating False Values
07:42 Checking Equality
09:38 Comparing Strings
09:59 Conclusion
10:25 Additional Note
Рекомендации по теме