So right now, I created an example of a JSON object where:
var myObj = {
address: {
0: ["41 Lake Avenue"]
},
name: "jake"
}
myObj itself as a whole is a JSON object, and inside it, I have two keys which are address and name respectively. So the value of the address key is also an Object since its in braces, where as the name key value is just a string.
I want to write a simple check in javascript to check whether or not the keys in myObj is an object or a string. So if its an object, it returns true where as if its not an object it returns false. Therefore for address, it would be true while for name, it would be false.
I tried looking around for some isObject() method similar to isArray() but apparently i couldn't find so I'd like some help on this so i wrote a pseudocode below for the logic:
for (i=0;i<2;i++) {
if myObj[i] is Object {
return true;}
else{
return false;}
}