I have a query, I would like to know how to validate if a JSON object is empty or not, try doing it with "undefined" or null but since I am new in this I am not sure if this is correct.
This is my code:
var v = {"Mail":"[email protected]","Copy":"", "cdd":"[email protected]"}
if( v.cdd !== undefined){
if(typeof(v.Mail) === 'string'){
if(typeof(v.Copy) === 'string' || v.Copy !== ""){
if(typeof(v.cdd === 'string' || v.cdd !== "")){
console.log("Todo bien")
}
}
}
}
I do not think it's very good, if you can please tell me if I can thank you for solving it or giving me an example.
Thank you.