Actually, there are two variants of vanilla JS on web browser.
The older one withoutimport, and rely on <script src=""> and attaching to Window object. (And IIFE, if you want to avoid polluting the global scope. As well as, you might want to add "use strict" at the top of JavaScript)
The newer one withimport, and rely on <script type="module">. This one will not pollute the global scope, nor window object by default. Also, strict by default. As well as, it may be more performant.
Deno tries to follow the second pattern as well. However, Node.js has a different thing, commonjs. ESM is just a recent addition.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Actually, there are two variants of vanilla JS on web browser.
import
, and rely on<script src="">
and attaching to Window object. (And IIFE, if you want to avoid polluting the global scope. As well as, you might want to add "use strict" at the top of JavaScript)import
, and rely on<script type="module">
. This one will not pollute the global scope, nor window object by default. Also, strict by default. As well as, it may be more performant.Deno tries to follow the second pattern as well. However, Node.js has a different thing, commonjs. ESM is just a recent addition.