JSFiddle - React, Tailwind, and code Playground

by moku23

JavaScript

const data = [
    2020.00,
    1980.00,
    1980.00,
    -9060.00,
    1575.00,
    1611.58,
    1808.32,
    1840.00,
    1760.00,
    1371.00,
    460.00,
    70.00,
    458.21,
    60.00,
    540.87
];

const total = data.reduce((acc, val) => acc + val, 0);
console.log(total);