I made same test with TypeScript and unfortunately this kind of code pass without warning. (:
After that I made same test with another language (Delphi) that Anders Hejlsberg (designer of TypeScript) designed 24 years ago and this old compiler report error. :)
I forgot to mention in my previous comment that your article is great.
Fortunately my compiler will report an error If I try something like that.
I think that you should write some hint for beginners, that this kind variable naming is not good pratice and should be avoided.
Oh yea I agree.
At the end, I reminded JD with this:
PSA: Use different names for counters in nested loops - to not only prevent errors, but helps in readability and clarity.
Not too sure if eslint helps with this, but I definitely wish there's an automatic way to catch it.
I made same test with TypeScript and unfortunately this kind of code pass without warning. (:
After that I made same test with another language (Delphi) that Anders Hejlsberg (designer of TypeScript) designed 24 years ago and this old compiler report error. :)
I forgot to mention in my previous comment that your article is great.
This option looks promising: eslint.org/docs/rules/no-shadow
Ahhhh yesss 👍