I'm creating one Object and assign null value then push some values into created object now i want check object is null or not?
here is my code
var data = {};
if(typeof first_name != 'undefined'){
data['first_name'] = first_name;
}
if(typeof last_name != 'undefined'){
data['last_name'] = last_name;
}
//checking value is null or not
if(typeof data !== null){
console.log(data);
}
else{
console.log('No Any values');
}
its give O/P this: Object {}