undefined vs not defined in JavaScript #javascript #programming #undefined #notdefined

preview_player
Показать описание
"undefined" indicates that a variable has been declared but not given a value, while "not defined" indicates that a variable does not exist
Use cases of 'undefined' :
(1) During creation phase of execution context.
(2) when you are not writing return in function it will return 'undefined'
Not defined : It is one of the type of reference error that JavaScript throw when someone access a variable which is in not memory heap.
Рекомендации по теме