Home > Web Front-end > JS Tutorial > JavaScript variable naming rules_basic knowledge

JavaScript variable naming rules_basic knowledge

WBOY
Release: 2016-05-16 18:46:05
Original
1545 people have browsed it

JScript is a case-sensitive language.

The first character must be an ASCII letter (upper or lower case), or an underscore (_). Note that the first character cannot be a number.
Following characters must be letters, numbers or underscores.
Variable names must not be reserved words.

Some examples of legal variable names are given below:
_pagecount Part9 Number_Items Some examples of invalid variable names are given below:

99Balloons // Cannot start with a number. Smith&Wesson // The ampersand (&) character is invalid for variable names.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template