From 35f450aa513cc9e2affcbf3108b9ec3c87553679 Mon Sep 17 00:00:00 2001 From: Dermot Hughes Date: Mon, 18 Oct 2021 18:06:18 +0100 Subject: [PATCH] Callback examples not using correct function name The examples aren't using the correct function names as defined. It could be confusing. --- blog_posts/js-callbacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog_posts/js-callbacks.md b/blog_posts/js-callbacks.md index 041484942..fc321a498 100644 --- a/blog_posts/js-callbacks.md +++ b/blog_posts/js-callbacks.md @@ -18,7 +18,7 @@ A synchronous callback is a callback function that is executed immediately. The const nums = [1, 2, 3]; const printDoublePlusOne = n => console.log(2 * n + 1); -nums.map(doublePlusOne); // LOGS: 3, 5, 7 +nums.map(printDoublePlusOne); // LOGS: 3, 5, 7 ``` ### Asynchronous callbacks @@ -29,5 +29,5 @@ An asynchronous callback is a callback function that is used to execute code aft const nums = fetch('https://api.nums.org'); // Suppose the response is [1, 2, 3] const printDoublePlusOne = n => console.log(2 * n + 1); -nums.then(printDouble); // LOGS: 3, 5, 7 +nums.then(printDoublePlusOne); // LOGS: 3, 5, 7 ```