How to check for “undefined” variable in JavaScript?
With JavaScript, I want to find whether a variable is ‘undefined’. The following is my code, but I am not sure about it and it checks both undefined and null:
function isEmpty(age) {
return (age === undefined || age == null) ? true : false;
}