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/
This commit is contained in:
IKoshelev
2020-12-25 18:39:11 +01:00
committed by GitHub
parent b9e7242cf7
commit fdaf5ee00b

View File

@@ -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"));
```