JSFiddle - React, Tailwind, and code Playground
JavaScript
let data = [
{
"node":[
{
"name":"aaaaa",
"count":"2",
}
]
},
{
"client":[
{
"name":"bbbbb",
"count":"2",
}
]
},
{
"ip_address":[
{
"name":"ccccc",
"count":"3",
}
]
},
{
"compute":[
{
"name":"dddd",
"count":"1",
}
]
}
]
let find_key = "ip_address";
//console.log(data[0].has(find_key));
console.log(data[0].hasOwnProperty(find_key));