In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article examines "sample analysis where javascript identifiers cannot start with a number". The content is detailed and easy to understand, "javascript identifiers can not start with a number of example analysis" interested friends can follow the editor's ideas slowly in-depth to read, I hope that after reading can be helpful to everyone. Let's learn more about the example analysis that javascript identifiers cannot start with numbers.
In javascript, identifiers cannot start with a number, that is, the first character cannot be a number, but must be a letter, an underscore "_" or a dollar sign "$", followed by a letter, a number or an underscore, a dollar sign; and identifiers cannot contain spaces and special characters such as "+", "-", "@", "#" and so on.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
Identifiers (Identifier) are technical terms for names. JavaScript identifiers include variable names, function names, parameter names, and attribute names.
Identifiers are names used by users when programming, which are used to name variables, constants, functions, statement blocks, and so on, in order to establish a relationship between name and use. Identifiers usually consist of letters and numbers and other characters.
In javascript, the naming convention for identifiers is the same as in Java and many other languages, and the main specifications are as follows:
The first character of the identifier must be a letter, underscore _, or dollar sign $, followed by a letter, number or underscore, dollar sign
Custom identifiers cannot have the same name as keywords and reserved words in JavaScript, but can contain keywords or reserved words. For an introduction to keywords and reserved words, see the introduction later in this section.
Identifiers cannot contain spaces
Identifiers cannot contain special characters such as +, -, @, #, etc
There are two main ways to name compound identifiers consisting of multiple words:
One is to connect each word with an underscore, and each word is lowercase, such as dept_name.
Second, the use of hump type, which is divided into big hump and small hump. The format of the big hump is the uppercase of the first letter of each word, and the other letters are lowercase. For example, the format of the DeptName; hump is all lowercase of the first word, the first letter of each word at the beginning of the second word is uppercase, and the rest of the letters are lowercase, such as deptName.
Example of a legal identifier:
User_nameuserName_name$nameabab123
Example of illegal identifier:
1a / / the first character is the number a b / / identifier contains spaces aqumb / / identifier contains the special symbol while / / keyword
JavaScript keywords are identifiers that have a specific meaning, such as to indicate the beginning or end of a control statement, or to perform specific actions that will be used in specific situations. JavaScript reserved words refer to identifiers that do not currently have a specific meaning, but may be used to express specific meanings in the future, such as class identifiers.
In order not to cause unnecessary problems, you cannot use JavaScript keywords and reserved words as variable or function names. Table 1 lists some common keywords and reserved words in JavaScript.
Table 1:JavaScript common keywords and reserved words JavaScript is a literal scripting language, its interpreter is called JavaScript engine, is a part of the browser, JavaScript is widely used in the client scripting language, the earliest use in HTML pages, used to add dynamic functions to HTML pages.
This is the end of the example analysis that javascript identifiers can't start with numbers. I hope the above content will improve everyone. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.