mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 08:16:50 +08:00
Fix/code smells (#1338)
* ♻️ refactor: improving and fixing some code * Updated Documentation in README.md * ♻️ refactor: improving isLeapYear * 🐛 chore: back changes * 🐛 fix: using reduce instead forEach * 🐛 fix: using reduce instead forEach * 🐛 fix: removing duplicated code * 🐛 chore: removing .js --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -41,8 +41,7 @@ function integralEvaluation (N, a, b, func) {
|
||||
|
||||
// Calculate the integral
|
||||
let result = h
|
||||
temp = 0
|
||||
for (let i = 0; i < pointsArray.length; i++) temp += pointsArray[i]
|
||||
temp = pointsArray.reduce((acc, currValue) => acc + currValue, 0)
|
||||
|
||||
result *= temp
|
||||
|
||||
|
Reference in New Issue
Block a user