From 4a22f07aac4ecc8eff8bbbd2944fb478105f4826 Mon Sep 17 00:00:00 2001 From: Uman Shahzad Date: Sun, 13 Oct 2019 18:45:09 +0500 Subject: [PATCH] Don't say that callbacks execute only at the end of the parent That's misleading because they can be executed anywhere in the parent, even multiple times (indeed functions accepting "callbacks" that operate on array items will call the function on each iteration). Simplify the wording here to explain only that the parent function can call it, without all the extra stuff which convolutes the definition. --- page/about-jquery/how-jquery-works.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/page/about-jquery/how-jquery-works.md b/page/about-jquery/how-jquery-works.md index 33cfb0cb..7be1e58a 100644 --- a/page/about-jquery/how-jquery-works.md +++ b/page/about-jquery/how-jquery-works.md @@ -165,9 +165,7 @@ Then the link slowly disappears when clicked. ## Callbacks and Functions -Unlike many other programming languages, JavaScript enables you to freely pass functions around to be executed at a later time. A *callback* is a function that is passed as an argument to another function and is executed after its parent function has completed. Callbacks are special because they patiently wait to execute until their parent finishes. Meanwhile, the browser can be executing other functions or doing all sorts of other work. - -To use callbacks, it is important to know how to pass them into their parent function. +Unlike many other programming languages, JavaScript enables you to freely pass functions around to be executed at a later time. A *callback* is a function that is passed as an argument to another function and is executed by that parent function. To use callbacks, it is important to know how to pass them into their parent function. ### Callback *without* Arguments