JavaScript guidelines this section describes other important things that need to be understood when JavaScript is used for encoding.
JavaScript is case sensitive.
A function named "myfunction" and a function named "myFunction" are two different functions. Similarly, variables "myVar" and variables "myvar" are different.
JavaScript is case sensitive-so when you create or use variables, objects, and functions, pay attention to the case sensitivity of characters.
Space
JavaScript ignores unnecessary spaces. Therefore, you can add appropriate spaces in the code to make the code more readable. The following two rows are equivalent:
Name = "Hege"
Name = "Hege" newline
You can use a backslash to line the code inside the string. The following example is correct:
Document. write ("Hello \
World! ") But cannot be broken like this:
Document. write \
("Hello World! ") Notes:
You can use two slashes to add comments:
// This is a comment
Document. write ("Hello World! ") You can also use/* and */: (in this way, you can create comments for multiple rows)
/* This is a comment
Block. It contains
Several lines */
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.