en.javascript.info icon indicating copy to clipboard operation
en.javascript.info copied to clipboard

Variables, Task 1: Change the "name" variable to avoid ambiguity for deprecated naming

Open aseiis opened this issue 3 years ago • 2 comments

The first task of the variables page suggest to declare and use two variables : admin and name.

Using name as the name of the variable can be confusing and code editors will show a warning: 'name' is deprecated.ts(6385) lib.dom.d.ts(17693, 5): The declaration was marked as deprecated here. (VSCode)

name variable should be renamed

aseiis avatar Aug 01 '22 18:08 aseiis

I didnt try... but it is not a reserved word, "let name" scope should override the global "name". editors shouldnt warn I think.

anyway, userName would comply with article recommendations

joaquinelio avatar Aug 01 '22 22:08 joaquinelio

I gave the warning VSCode gave me above (name variable was crossed out). Yup, I agree: username would better fit I believe!

aseiis avatar Aug 02 '22 22:08 aseiis

#3299

ghost avatar Dec 10 '22 17:12 ghost