JSFiddle - React, Tailwind, and code Playground
HTML
Summed ages: <span></span>
JavaScript
"use strict";
let data = JSON.parse('[{"employee":[{"firstname":"Harry","birthdate":"1965-10-05","age":50}]},{"employee":[{"firstname":"Pete","birthdate":"1985-10-09","age":30}]}]');
document.querySelector('span').innerText = sumAllAges(data);
function sumAllAges(data) {
return data.reduce(function(total, obj) {
return total + obj.employee[0].age;
}, 0);
}