I need to get the key that has the value > 0 in this example would be 005340302403, how could I do that?
var json = {
"productSkuInventoryStatus": {
"005340304004": 0,
"005340304003": 0,
"005340304002": 0,
"005340304001": 0,
"005340302401": 0,
"005340302402": 0,
"005340301401": 0,
"005340304005": 0,
"005340301403": 0,
"005340302405": 0,
"005340301402": 0,
"005340301405": 0,
"005340302403": 1,
"005340301404": 0,
"005340302404": 0
}
}
var array1 = Object.values(json.productSkuInventoryStatus);
const found = array1.find(element => element > 0);
console.log(found)// get de value > 0
// how to get the key of this value greater than 0