+ 15
Choose the names that are acceptable for JavaScript variables.
Easy answer
6 ответов
+ 22
Mikel Sánchez, Thank you so much for your guide line and help
+ 14
I hope you aren't testing our knowledge or something.
It's explained right in the js lesson.
" Naming rules:
- The first character must be a letter, an underscore (_), or a dollar sign ($). Subsequent characters may be letters, digits, underscores, or dollar signs.
- Numbers are not allowed as the first character.
- Variable names cannot include a mathematical or logical operator in the name. For instance, 2*something or this+that;
- JavaScript names must not contain spaces.
"
https://www.sololearn.com/learn/JavaScript/1128/
For an extended information check this stack over question. it can help.
https://stackoverflow.com/questions/1661197/what-characters-are-valid-for-javascript-variable-names
+ 9
Most conventions require that camelCase be used to name variables. Even so, there are many people who use other alternate or personal conventions.
If they are not using a linter there are also people who are not aware of the appointment of elements and other aspects of the language.
I'll cover some guides on this, maybe can be useful:
https://github.com/airbnb/javascript
https://google.github.io/styleguide/jsguide.html
https://www.w3schools.com/js/js_conventions.asp
+ 1
Answear is _module and
firstNumber
0
is
_module
firstNumber
0
_module
firstNumber