From b5a08656ebec5d883c17f9f3e743b29dbeee7708 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Wed, 16 Oct 2019 00:42:28 +0300 Subject: [PATCH] minor --- 1-js/11-async/01-callbacks/article.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/1-js/11-async/01-callbacks/article.md b/1-js/11-async/01-callbacks/article.md index c2f67c6c..c590b365 100644 --- a/1-js/11-async/01-callbacks/article.md +++ b/1-js/11-async/01-callbacks/article.md @@ -2,9 +2,19 @@ # Introduction: callbacks +```warn header="We use browser methods here" +To demonstrate the use of callbacks, promises and other abstract concepts, we'll use browser methods. Namely, load scripts and perform simple document manipulations. + +If you're not familiar with them, please read few chapters from the [next part](/document) of the tutorial. + +Or, maybe examples will be clear enough for you even without that. +``` + Many actions in JavaScript are *asynchronous*. -For instance, take a look at the function `loadScript(src)`: +For instance, we can schedule such actions using `setTimeout`. + +There are other real-world examples of asynchronous actions, e.g. take a look at the function `loadScript(src)`, that should load a new script with the given `src`: ```js function loadScript(src) { @@ -14,18 +24,18 @@ function loadScript(src) { } ``` -The purpose of the function is to load a new script. When it adds the `