From 006343a653cc7125d0871306d10f21f13b69839b Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 24 May 2021 11:23:44 +0300 Subject: [PATCH] minor fixes --- 1-js/13-modules/01-modules-intro/article.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/1-js/13-modules/01-modules-intro/article.md b/1-js/13-modules/01-modules-intro/article.md index d6006f8f..dfc247da 100644 --- a/1-js/13-modules/01-modules-intro/article.md +++ b/1-js/13-modules/01-modules-intro/article.md @@ -123,9 +123,11 @@ That said, making such global variables is frowned upon. Please try to avoid the ### A module code is evaluated only the first time when imported -If the same module is imported into multiple other places, its code is executed only the first time, then exports are given to all importers. +If the same module is imported into multiple other modules, its code is executed only once, upon the first import. Then its exports are given to all further importers. -That has important consequences. Let's look at them using examples: +The one-time evaluation has important consequences, that we should be aware of. + +Let's see a couple of examples. First, if executing a module code brings side-effects, like showing a message, then importing it multiple times will trigger it only once -- the first time: