From a5d3317c7da284dafc1ae26b16627df81dc6b4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Fri, 23 Mar 2018 14:28:58 +0100 Subject: [PATCH] fix bug in 'attempt' snippet --- snippets/attempt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/attempt.md b/snippets/attempt.md index c3dae169e..4cf9aa9a6 100644 --- a/snippets/attempt.md +++ b/snippets/attempt.md @@ -7,7 +7,7 @@ Use a `try... catch` block to return either the result of the function or an app ```js const attempt = (fn, ...args) => { try { - return fn(args); + return fn(...args); } catch (e) { return e instanceof Error ? e : new Error(e); }