Skip to content

Commit feae726

Browse files
committed
🐛 fix: using reduce instead forEach
1 parent 8d2cbda commit feae726

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Maths/MidpointIntegration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function integralEvaluation (N, a, b, func) {
4141

4242
// Calculate the integral
4343
let result = h
44-
temp = pointsArray.reduce((acc, currValue) => acc + currValue, 0);
44+
temp = pointsArray.reduce((acc, currValue) => acc + currValue, 0)
4545

4646
result *= temp
4747

Maths/SimpsonIntegration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function integralEvaluation (N, a, b, func) {
5454

5555
// Calculate the integral
5656
let result = h / 3
57-
temp = pointsArray.reduce((acc, currValue) => acc + currValue, 0);
57+
temp = pointsArray.reduce((acc, currValue) => acc + currValue, 0)
5858

5959
result *= temp
6060

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy