Javascript Array Reduce Initial Value Calculator