I have 3 objects.
obj([]);
obj([{name:'Jeans', quantity:5}]);
obj([{name:'Jeans-M-B', quantity:1},{name:'Jeans-S-R', quantity:7}]);
I am trying to add the quantity values together which should equal to 13. I can't seem to grasp on how to actually get the values. When I tried the code below, it just gives me the objects themselves instead of their values.
function obj(itemsObj) {
var obj = Object.values(itemsObj);
console.log(obj.quantity);
}