I have following JSON string :
obj=[{"name":"Marine Lines","location_id":3}, {"name":"Ghatkopar","location_id":2}] var res = []; for (var x in obj) if (obj.hasOwnProperty(x)) res.push(obj[x].location_id); console.log(res.join(","));