Path: csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Mild Shock Newsgroups: comp.lang.javascript Subject: Do not use var / what about import [Confusion by John Harris] Date: Sun, 24 Mar 2024 14:04:41 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 24 Mar 2024 13:04:39 -0000 (UTC) Injection-Info: solani.org; logging-data="1865561"; mail-complaints-to="abuse@news.solani.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.1 Cancel-Lock: sha1:cFTfSAHnxfu3C4ab1XBMlnwXu7k= X-User-ID: eJwFwQkBgAAIA8BK8g7iCLL+EbwLS8mFZ6QHg6OG4l19tyPnjQqUzagQLurSLwD2eqFw3zMehlRyrUN/Ug0U/w== X-Mozilla-News-Host: news://news.solani.org:119 Xref: csiph.com comp.lang.javascript:124324 Attention to John Harris In case you are about to go on a fishing spree for F.U.D. like here: Fear, Uncertainty and Doubt https://de.wikipedia.org/wiki/Fear,_Uncertainty_and_Doubt Be warned, your findings might mostlikely come out as lame accusations. Judging from your JavaScript tutorials your are stuck somewhere in the yesterdays yesterday of JavaScript, you write: > First, inside a function definition > var v; > makes v a local variable. > [...] > However, in 2015 two other kinds of variable > were introduced that do have block scope. They > are declared using the keywords const and > let instead of var. https://www.jghnorth.org.uk/notes/JSfeats.html Why not just admit that var is practically deprecated, and make a fresher of your nonsene tutorials, remove it? It's probably only still there for backward compatibility. 4 Reasons Why ‘var’ is Considered Obsolete in Modern JavaScript https://plainenglish.io/blog/4-reasons-why-var-is-considered-obsolete-in-modern-javascript Also I doubt you can run Dogelog Player for JavaScript with your mindset, it requires ES6 modules.