Javascript study notes (1)

DOM: Document Object Model, is the HTML and XML application programming interfaces, DOM tag to a page plan into a tree of nodes, developers can realize the operation of each node.

BOM: Browser Object Model, developers can make the browser window to access and manipulate.

1, points to note

1.Javascript everything is case sensitive.

2.Javascript variables are weakly typed, can be used directly without prior declaration, declare a variable with the var keyword, you can also assign the variables declared. One can declare multiple variables, each variable with a comma (,) separated. Variable name can be letters, underscores, dollar signs at the beginning.

3. Note sub-line comment and multi-line comments, single line beginning with / / more lines to / * start * / end.

4. The original value stored in the variable value directly accessible location, the reference value is stored in a variable is just a pointer to the object stored in memory office.

5.Javascript data type there are five: undefined, null, boolean, string, number. Typeof types of variables available.

 Second, operators

1. Unary operator: delete, void ,++,--,+,-

2. Bitwise operators :~,&,|,^,<<,>>,>>>

3. Logical Operators :!,||,&&

4. Multiplicative operator :*,/,%

5. Additive operators: +, -

6. Relational operators :<,>,<=,>=

7. Reciprocity operator :==,!=,===,!==

8. Conditional operator: variable = boolean_expression? True_value: false_valeu

9. Assignment Operators :=,+=,-=,*=,/=,%=,<<=,>>=,>>>=

Third, the statement

1.if statement:

The first: if (condition) statement1 else statement2

The second: if (condition) statement1 else if (condition2) statement2 else statement3

2.do-while statement:

do (
    statement
) While (expression);

3.while statement:

while (expression) (
  statement
)

4.for statement:

for (initialization; expression; post-loop-expression) (
  statement
)

5.for-in statement:

for (property in expression) (
  statement
)

6.break statement and continue statement:

break for the exit the loop, continue to exit the current loop, with the next cycle.

7.with statement:

with (expression) (
  statement;
)

8.switch statement:

switch (expression) (
  case value: statement
           break;
  case value2: statement2
           break;
...
  defaule: statement
)

Declined comment