I have this code. I need to write a validation for this object. if any of the property is empty or not a string console log an error or console log a message.
var obj = { ob1 : {"val1" : "test1", "val1" : "test1"},
ob2 : ["v2", "v3", "v4"]
};
for (var property in obj){
if (typeof obj[property] !=='string' || obj[property] === ""){
console.log(property + ' is empty or not a string!');
}};
how do I write code or fiunction to ob1 and ob2.