diff --git a/1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/task.md b/1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/task.md index 550bf52da2..fa52871a0e 100644 --- a/1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/task.md +++ b/1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/task.md @@ -6,6 +6,8 @@ importance: 5 The result of `debounce(f, ms)` decorator is a wrapper that suspends calls to `f` until there's `ms` milliseconds of inactivity (no calls, "cooldown period"), then invokes `f` once with the latest arguments. +In other words, `debounce` is like a secretary that accepts "phone calls", and waits until there's `ms` milliseconds of being quiet. And only then it transfers the latest call information to "the boss" (calls the actual `f`). + For instance, we had a function `f` and replaced it with `f = debounce(f, 1000)`. Then if the wrapped function is called at 0ms, 200ms and 500ms, and then there are no calls, then the actual `f` will be only called once, at 1500ms. That is: after the cooldown period of 1000ms from the last call. @@ -25,7 +27,6 @@ setTimeout( () => f("c"), 500); // debounced function waits 1000ms after the last call and then runs: alert("c") ``` - Now a practical example. Let's say, the user types something, and we'd like to send a request to the server when the input is finished. There's no point in sending the request for every character typed. Instead we'd like to wait, and then process the whole result. @@ -43,9 +44,8 @@ See? The second input calls the debounced function, so its content is processed So, `debounce` is a great way to process a sequence of events: be it a sequence of key presses, mouse movements or something else. - It waits the given time after the last call, and then runs its function, that can process the result. The task is to implement `debounce` decorator. -Hint: that's just a few lines if you think about it :) \ No newline at end of file +Hint: that's just a few lines if you think about it :) diff --git a/1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md b/1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md index 0ab09e640c..6df7af1327 100644 --- a/1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md +++ b/1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md @@ -12,6 +12,8 @@ The difference with debounce is that it's completely different decorator: - `debounce` runs the function once after the "cooldown" period. Good for processing the final result. - `throttle` runs it not more often than given `ms` time. Good for regular updates that shouldn't be very often. +In other words, `throttle` is like a secretary that accepts phone calls, but bothers the boss (calls the actual `f`) not more often than once per `ms` milliseconds. + Let's check the real-life application to better understand that requirement and to see where it comes from. **For instance, we want to track mouse movements.** diff --git a/9-regular-expressions/03-regexp-unicode/article.md b/9-regular-expressions/03-regexp-unicode/article.md index 5bc0196bb0..04d0cfb4e2 100644 --- a/9-regular-expressions/03-regexp-unicode/article.md +++ b/9-regular-expressions/03-regexp-unicode/article.md @@ -33,6 +33,7 @@ alert('𝒳'.length); // 2 ## μœ λ‹ˆμ½”λ“œ ν”„λ‘œνΌν‹° \p{...} +<<<<<<< HEAD ```warn header="Firefox와 Edgeμ—μ„œ 미지원" 2018λ…„λΆ€ν„° ν‘œμ€€μ— ν¬ν•¨λ˜μ—ˆμ§€λ§Œ Firefox([버그](https://bugzilla.mozilla.org/show_bug.cgi?id=1361876))와 Edge([버그](https://github.com/Microsoft/ChakraCore/issues/2969))λŠ” μœ λ‹ˆμ½”λ“œ ν”„λ‘œνΌν‹°λ₯Ό 아직 μ§€μ›ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. @@ -40,6 +41,9 @@ alert('𝒳'.length); // 2 ``` μœ λ‹ˆμ½”λ“œμ˜ λͺ¨λ“  λ¬ΈμžλŠ” λ‹€μ–‘ν•œ ν”„λ‘œνΌν‹°λ₯Ό κ°€μ§‘λ‹ˆλ‹€. ν”„λ‘œνΌν‹°λŠ” λ¬Έμžκ°€ μ–΄λ–€ 'λ²”μ£Ό'에 μ†ν•˜λŠ”μ§€ μ„€λͺ…ν•˜κΈ°λ„ ν•˜κ³  κ·Έ 외에도 문자의 μ—¬λŸ¬ κ°€μ§€ 정보λ₯Ό λ‹΄κ³  μžˆμŠ΅λ‹ˆλ‹€. +======= +Every character in Unicode has a lot of properties. They describe what "category" the character belongs to, contain miscellaneous information about it. +>>>>>>> b85413d0bdd6f4f468fcadeacb4c4056e3671ce1 예λ₯Ό λ“€μ–΄ λ¬Έμžμ— `Letter` ν”„λ‘œνΌν‹°κ°€ μžˆλ‹€λ©΄ κ·Έ λ¬ΈμžλŠ” μ–΄λ– ν•œ μ–Έμ–΄μ˜ κΈ€μžλΌλŠ” λœ»μž…λ‹ˆλ‹€. `Number` ν”„λ‘œνΌν‹°κ°€ μžˆλ‹€λ©΄ 아라비아 μˆ«μžλ“  ν•œμž μˆ«μžλ“  μˆ«μžλΌλŠ” 뜻이죠.