From 5fdf9442d88ee396b57c6c38929b919cec6178dc Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 1 Jan 2018 16:22:06 +0200 Subject: [PATCH] Update sumPower.md --- snippets/sumPower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/sumPower.md b/snippets/sumPower.md index 846989089..7721c3747 100644 --- a/snippets/sumPower.md +++ b/snippets/sumPower.md @@ -7,7 +7,7 @@ Omit the second argument, `power`, to use a default power of `2`. Omit the third argument, `start`, to use a default starting value of `1`. ```js -const sumPower = (end,power = 2,start = 1) +const sumPower = (end,power = 2,start = 1) => Array(end - start).fill(0).map((x,i) => (i+start) ** power).reduce((a,b) => a+b,0) ```