JavaScript type tests

by Town

JavaScript

var test = {};
test.inner = {};

if (test !== undefined) {
console.log("test is populated");
}
if (test === undefined) {
console.log("test is undefined");
}
if (test.inner === undefined) {
console.log("test.inner is undefined");
}
if (test.inner !== undefined) {
console.log("test.inner is populated");
}