hankknight
asked on
JavaScript: Check if sub variable defined
How can I do this without errors?
if (typeof (x) !== undefined && typeof (x.y) !== undefined) {
alert('x.y not defined');
}
else {
alert('x.y is defined');
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.