JSFiddle - React, Tailwind, and code Playground

by Vladymyr Shevchuk

JavaScript

var initialValue = 0;
var sum = [{x: 1}, {x:2}, {x:3}].reduce(function (accumulator, currentValue) {
    console.log(accumulator.x, `--`,currentValue.x )
    return accumulator.x + currentValue.x;
});
console.log(sum);