It should be if(typeof family[prop] === "string")
for(prop in family){
if(typeof family[prop] === "string"){
console.log(family[prop]);
}
}
prop
represents the key and its always "string
" whereas you need to use family[prop]
which will return you the value you have stored in the object