Skip to content

Commit d85849e

Browse files
authored
Fixed derivative example
1 parent b92b1af commit d85849e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ note: `ys[0]` represents the first "known" value, which is the value furthest to
224224
return ys.map((y, index) => {
225225
const x = xs[index];
226226
const dateDelta = x - last.x;
227-
accumulator += (y - last.y) / dateDelta;
227+
const yDelta = (y - last.y) / dateDelta;
228228
last = { x, y };
229-
return accumulator;
229+
return yDelta;
230230
})
231231
}
232232
```

0 commit comments

Comments
 (0)