I am with some doubts about iterate into a JS Object and some array functions in JavaScript. Let's say I have these variables:
var json1 = "[{"id": 1, "name":"x"}, {"id": 2, "name":"y"}]";
var json2 = "[{"id": 1, "name":"x"}, {"id": 2, "name":"y"}, {"id": 3, "name":"z"}]";
How can I make a variable with only the IDs in a array
var ids1 = json1.ids (would be 1,2)
var ids2 = json2.ids (would be 1,2,3)
and make another variable only with the IDs that are different
var idsdiff = diff(ids1, ids2) (would be 3)