Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e5543f commit 40419bdCopy full SHA for 40419bd
1 file changed
Project-Euler/Problem013.js
@@ -108,7 +108,10 @@ const numbers = [
108
]
109
110
const findFirstTenDigitsOfSum = () => {
111
- const sum = numbers.reduce((prev, current) => current += prev, 0)
+ const sum = numbers.reduce((prev, current) => {
112
+ current += prev
113
+ return current
114
+ }, 0)
115
116
return sum.toLocaleString('fullwide', { useGrouping: false }).split('').slice(0, 10).join('')
117
}
0 commit comments