The basic concept --- part2

In this chapter we continue to introduce basic concepts of js, a journey of a thousand miles begins with a single step, we have to pay attention to good foundation

Keywords and reserved words

js ECMA-262 has been described having a set of particular use keywords , which keywords are used to specifically control the start and end of the sentence, or the like to perform specific operations. In accordance with the provisions of the keyword is not used as an identifier so js what keyword it?

In fact, we do not rote, we often encounter these keywords in the encoding process after in
addition to the keyword ECMA-262 also describes a set of reserved words can not be used as identifiers (A current version is also However, no specific future use as a keyword is likely to occur "could key" ).

Reserved words become keywords do not mind to use

variable

js variable weak type (otherwise known as a loose-type), is called weak type can be used to store any type of data, each variable is just a placeholder for storing any type of value only, to use the definition of variables "var" For example:

In this variable to hold the value of the variable num is the number 1, since referred to the types of data we took love to spend much more substantial space to talk knowledge of the type of data, we use this to open a chapter head:

type of data

ECMAScript there are 5 simple data types (undefined, null, boolean, number , string) there is a complex data type (object) we have to distinguish them we must first learn a tool "typeof"
for any variable which can be any js data types, so we need typeof to detect a given variable data type is responsible for this typeof operator information, such as:

Num can typeof to determine the type of data that number
in the next chapter we want to highlight some data types and their usage

Guess you like

Origin blog.csdn.net/weixin_33883178/article/details/91398885