Get the App
SLTechnology News&Howtos  ›  Development  › 

A brief introduction to the naming rules of identifiers in JavaScript

Shulou Source: shulou.com Published: 2022-06-03 19:39:47 10月04日 Update

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!

Tags: Identification identifiers rules words variables letters content beginning learning practical deeper special underlined between representatives interests capitals practicality actual situation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MariaDB Docker MySQL Microsoft