Skip to content

[DEMO] Remove unnecessary loop in calculateTotal #2

@ashleywolf

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions