I am having below object where I am trying to get all the id values.
[{ \"type\": \"test\", \"id\": \"100\", \"values\": { \"name\": \"A
function getIds(obj) { for (var x in obj) { if (typeof obj[x] === 'object') { getIds(obj[x]); } else if (x === 'id') { console.log(obj.id); } } }