In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to write comments and identifiers of JavaScript". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
JavaScript comment
Not all JavaScript statements are executed.
The code between the double slash / / or / * and * / is considered a comment.
Comments are ignored and not executed:
Var x = 7; / / will execute
/ / var x = 8; will not execute
JavaScript identifier
The identifier is the name.
In JavaScript, identifiers are used to name variables (as well as keywords, functions, and tags).
In most programming languages, the rules for legal names are mostly the same.
In JavaScript, the first character must be a letter, an underscore (-), or a dollar sign ($).
A series of characters can be letters, numbers, underscores, or dollar signs.
Tip: the numeric value cannot be used as the first character. This way, JavaScript can easily distinguish between identifiers and numeric values.
JavaScript is case sensitive
All JavaScript identifiers are case sensitive.
The variables lastName and lastname are two different variables.
LastName = "Gates"
Lastname = "Jobs"
JavaScript does not translate VAR or Var into the keyword var.
JavaScript and hump case
Historically, programmers have used three ways to concatenate multiple words into a variable name:
Hyphen:
First-name, last-name, master-card, inter-city.
Note: hyphens cannot be used in JavaScript. It is reserved for subtraction.
Underline:
First_name, last_name, master_card, inter_city.
Hump case (Camel Case):
FirstName, LastName, MasterCard, InterCity.
CamelCase
JavaScript programmers tend to use hump capitalization that begins with lowercase letters:
FirstName, lastName, masterCard, interCity
This is the end of the content of "how to write the comments and identifiers of JavaScript". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.