1.1 first, Learn to use the Firebug console. Set the configuration options in Firefox to make JavaScript warnings more restrictive in the console ... To make it easier for us to find unnecessary bugs in the Program.
1. Enter About:config in the Firebox address bar of the Firefox browser;
2. Enter strict in the Filter's search field and press enter;
3. Double-click the line of the JAVASCRIPT.OPTIONS.STRICT option to change its value to True.
2.1 The usual variables are the one we use to store the Data. In particular, when we use a certain number (eg 3.141592653589793), it is more convenient to use the variable pi than to write the numeric values Directly.
The use of variables can usually be divided into two steps:
1. Declaring a variable 2. Initialize the argument, give it an initial value
var a= 1;
Variable names can be combined by any number, underscore. You cannot start with a number. The variable name is Case-sensitive.
Variable initialization, in effect, refers to the time when the variable is first Assigned.
There are two ways to 1. Declare the variable first, and then initialize the 2 declaration to synchronize with the Initialization.
3.1 javascript, which mainly contains the following in the basic data types
1. The number---------------includes floating-point numbers and Integers. eg:1,100,3.14, etc.
2. The string-------------a sequence of arbitrary mathematical characters, such as "a", "one", "broken-hearted-throwing".
3. Boolean value----------------true or False
4.undefined----------when we try to access a non-existent variable, we get a special value Undefined. In addition, the use of an uninitialized variable is also True. Javacript automatically sets the value of the variable before initialization to Underfined.
5.null----------------this is another special data type that contains only a single Value. The so-called null value, is no value, null value, does not represent anything.
6. Non-basic Type (I.E. Object)
3.2 View type operator typeof
If we want to know the data type of a variable or value, we can call a special operator called Typeof. The operator returns a string representing the data type. 、
Its values include: number,string,boolen,undefined,object, function ....
Undefined
0
NaN
False
Beginner JavaScript variables and basic data types