A brief introduction to the naming rules of identifiers in JavaScript
This article mainly explains "A brief introduction to the naming rules of identifiers in JavaScript". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "A brief introduction to the naming rules of identifiers in JavaScript".
There are the following rules for naming identifiers in JavaScript:
Made up of letters, numbers, $, _
Start with the letter, $, _
Do not use reserved words!
Be meaningful!
Naming conventions for identifiers:
1. Hump nomenclature
Except for the first word of the identifier, the first letter of the other words is capitalized, for example: trueName
two。 Snake nomenclature
Words are separated by _, for example: true_name
(note: in most cases, identifiers that begin with 1 or 2 underscores represent special or internal variables. When we define them ourselves, we try to avoid using variables that begin with an underscore.)
At this point, I believe you have a deeper understanding of "A brief introduction to the naming rules of identifiers in JavaScript". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!