I am using this code to check undefined variable but it\'s not working.
It's because it's already null or undefined. Null or undefined does not have any type. You can check if it's is undefined first. In typescript (null == undefined)
is true.
if (uemail == undefined) {
alert('undefined');
} else {
alert('defined');
}
or
if (uemail == null) {
alert('undefined');
} else {
alert('defined');
}