From 2ac771a0ced60ca9beb2e1ff9b6fcfbd5879d274 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Tue, 20 Nov 2018 19:39:53 +0530 Subject: [PATCH] update to reflect the fact that console has spec As `console.*` functions are supposed to follow the spec https://console.spec.whatwg.org/, the text about it is updated. --- async & performance/ch1.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/async & performance/ch1.md b/async & performance/ch1.md index c440ebd23..993094859 100644 --- a/async & performance/ch1.md +++ b/async & performance/ch1.md @@ -96,9 +96,7 @@ Any time you wrap a portion of code into a `function` and specify that it should ### Async Console -There is no specification or set of requirements around how the `console.*` methods work -- they are not officially part of JavaScript, but are instead added to JS by the *hosting environment* (see the *Types & Grammar* title of this book series). - -So, different browsers and JS environments do as they please, which can sometimes lead to confusing behavior. +The `console.*` methods are not officially part of JavaScript, but are instead added to JS by the *hosting environment* (see the *Types & Grammar* title of this book series). Despite having a standard specification, different browsers and JS environments do as they please, which can sometimes lead to confusing behavior. In particular, there are some browsers and some conditions that `console.log(..)` does not actually immediately output what it's given. The main reason this may happen is because I/O is a very slow and blocking part of many programs (not just JS). So, it may perform better (from the page/UI perspective) for a browser to handle `console` I/O asynchronously in the background, without you perhaps even knowing that occurred.