It appears from your code that your vm.occupantDetail.contactDetail
object is simply an empty object, and the __proto__
property that you are seeing is the protoype property of the Object
. If you want to check if an object is null
, the following conditional will do the job.
if (obj == null) { ... }
However, it appears that you want to check if an object is empty, which is different. If you want to check if a specified object has no assigned properties, try the following function.
function isEmpty(map) {
for(var key in map) {
if (map.hasOwnProperty(key)) {
return false;
}
}
return true;
}