JSFiddle - React, Tailwind, and code Playground
JavaScript
var collection = [{
"Name": "Charlie",
"ID": "13"
}, {
"Name": "Emma",
"ID": "9"
}, {
"Name": "Bob",
"ID": "5"
}];
total = 0, //set a variable that holds our total
id = collection, //reference the element in the "JSON" aka object literal we want
i = 0;
for (i = 0; i < id.length; i++) { //loop through the array
total += id[i].ID; //Do the math!
}
console.log(total); //display the result