From fdaf5ee00b77e3a3625d821985fb42c106778270 Mon Sep 17 00:00:00 2001 From: IKoshelev Date: Fri, 25 Dec 2020 18:39:11 +0100 Subject: [PATCH] Update ch. 0, "Background information", JS sample In JavaScript, fat arrow functions consisting of one expression (as opposed to a block of code body incased in '{' '}') don't need and can't have a `return` statement. Sample code being fixed was not valid JS: https://jsfiddle.net/dbzn1tcj/ --- src/0_background_information.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/0_background_information.md b/src/0_background_information.md index 387f3c7..b95de9e 100644 --- a/src/0_background_information.md +++ b/src/0_background_information.md @@ -522,8 +522,8 @@ function timer(ms) { } timer(200) -.then(() => return timer(100)) -.then(() => return timer(50)) +.then(() => timer(100)) +.then(() => timer(50)) .then(() => console.log("I'm the last one")); ```