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

JavaScript variable naming rules_basic knowledge

WBOY
WBOYOriginal
2016-05-16 18:46:051540browse

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.

Statement:
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