I have following JSON string :
try this
var obj = [{"name":"Marine Lines","location_id":3},{"name":"Ghatkopar","location_id":2}]; var output = obj.map( function(item){ return item.location_id; }); console.log( output.join(",") )