Update task.md

This commit is contained in:
LeviDing 2020-11-17 20:58:33 +08:00 committed by GitHub
parent 6db57d9494
commit 15780b3a24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,9 +21,9 @@ Here's the code for it (uses the debounce decorator from the [Lodash library](ht
```js
let f = _.debounce(alert, 1000);
f("a");
f("a");
setTimeout( () => f("b"), 200);
setTimeout( () => f("c"), 500);
setTimeout( () => f("c"), 500);
// debounced function waits 1000ms after the last call and then runs: alert("c")
```