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.
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.