const petsLists = [
    { name: 'Dog', age: 4 },
    { name: 'Cat', age: 6 },
    { name: 'Finches', age: 8 },
    { name: 'Hamster', age: 1 },
    { name: 'Squirrel', age: 2 },
    { name: 'Betta Fish', age: 0.5 },
];

const total = petsLists.reduce(function(sum, element){
  return sum + element.age;
}, 0);

console.log(total);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://codepen.io/nullobject/pen/cngzI.js