javascript - How can I determine if a variable is 'undefined' or 'null'?

preview_player
Показать описание
How do I determine if a variable is undefined or null?
My code is as follows:
var EmpName = $("div#esd-names div#javascript if(EmpName == 'undefined'){
// DO SOMETHING
};

div id="esd-names"
div id="name"/div
/div

But when I do this, the JavaScript interpreter halts execution.
Рекомендации по теме
Комментарии
Автор

It will never stop blowing my mind, that there barely anything so purely logical like programming and yet we have JavaScript with all the nonsense

JechtNH