-1

This is the format of the JSON object I am trying to retrieve field TEMP from.

[
    [
        {
            "DEVICE_ID": "357807272",
            "TEMP": 20.439
        }
     ]
 ]
Nirbhay Singh
  • 1,204
  • 1
  • 12
  • 16
lousybear
  • 453
  • 3
  • 12

1 Answers1

-1

Use javascript filter to retrieve objects, please find below code snippet:

var heroes = [
{name: 'Batman', franchise: 'DC'},
{name: 'Ironman', franchise: 'Marvel'},
{name: 'Thor', franchise: 'Marvel'},
{name: 'Superman', franchise: 'DC'}
];

var marvelHeroes =  heroes.filter(function(hero) {
 return hero.franchise == 'Marvel';
});
console.log(marvelHeroes);
Sarvesh Mahajan
  • 914
  • 7
  • 16