Is there a way to retrieve the name 'muxEnvironments' as a string from the object? I need it in order to analyze and compare the content type.
When I use console.log(obj)
, the entire object is displayed.
My objective is something like this:
jsonObjectName = obj;
if(jsonObjectName =='muxEnviroments'){do the stuff...}
But how can I extract the string 'muxEnvironments'?
{
"muxEnviroments": [
{
"primaryTransmitterName": "sfu5",
"primaryTransmitterIp": "10.7.50.1"
},
{
"primaryTransmitterName": "sfu1",
"primaryTransmitterIp": "10.7.50.4"
}
]
}