Assuming the incoming JSON is something like the following:
var incomingList = [{
"name": "Homer Simpson",
"age": 45,
"occupation": "Nuclear Plant Technician",
...
},{
"name": "Marge Simpson",
"age": 44,
"occupation": "Homemaker",
...
},
...
]
You could extract the name and age only into a similar array of objects:
var nameAndAgeList = incomingList.map(function(item) {
return {
name: item.name,
age: item.age
};
});
JavaScript only has objects and arrays, not tuples. If your data is associative (each record has key-value-pairs with the field name as the key) then the above approach will work fine.
However, if you need to associate the names and ages in a single object as key-value-pairs (like an associative array) with names as keys and ages as values, the following will work (assuming the names are unique):
var namesAndAges = incomingList.reduce(function(result,item) {
result[item.name] = item.age;
return result;
},{});