javascript - Check is object exists in property -


this question has answer here:

i trying see if property contains object.

i have this:

{   "prop1": "value",   "prop2": "value",   "prop4": "value",   "prop5": {       "innerprop1": "value",       "innerprop2": "value"   },   "prop6": {       "innerprop3": "value",       "innerprop4": "value"   } } 

i want know if of properties has object in it.

any appreciated.

please check prop7

obj = {    "prop1": "value",    "prop2": "value",    "prop4": "value",    "prop5": {        "innerprop1": "value",        "innerprop2": "value"    },    "prop6": {        "innerprop3": "value",        "innerprop4": "value"    },    "prop7": [] // object!  }    for(var key in obj) {      if(typeof obj[key] === 'object') {      console.log(key)    }  }


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -