diff --git a/snippets/arraySum.md b/snippets/arraySum.md index 31533d929..265c7fc60 100644 --- a/snippets/arraySum.md +++ b/snippets/arraySum.md @@ -5,6 +5,6 @@ Returns the sum of an array of numbers. Use `Array.reduce()` to add each value to an accumulator, initialized with a value of `0`. ```js -const arraySum = zarr => arr.reduce((acc, val) => acc + val, 0); +const arraySum = arr => arr.reduce((acc, val) => acc + val, 0); // arraySum([1,2,3,4]) -> 10 ```