Skip to content

[DEMO] Remove unnecessary loop in calculateTotal #2

Description

@ashleywolf

Description:

The calculateTotal function previously used an explicit for loop to sum numbers, which was verbose and harder to read.

Expected Behavior:

Use Array.prototype.reduce() to calculate the total in a single expression for clarity and performance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions