1. What is JavaScript?
is an object-based client-side scripting language used to interact with Web pages
2. Web Page Three layer structure
Behavior layer of structural layer expression layer
3, the composition of JavaScript
ECMAScript (European Association of Computer manufacturers, not a language, but an organization, used to standardize the grammar standards of JavaScript)
BOM (Browser object model)
DOM (Document Object model)
4. JavaScript implementation
Using the script tag to implement
Implemented by external introduction
5. JavaScript Output statements
Alert () Console.log () document.write ()
6, JS in the output of the results to pay attention to several issues
A: If the output is a character, the character must be enclosed in quotation marks.
B: If the output is a variable value, the variable must not be enclosed in quotation marks.
C: If both the output character and the output variable, between the character and the variable with + represents the connection
D: If the output is a numeric value, the array can be enclosed in quotation marks.
7. Basic data type
Number string Boolean object undefined null function
typeof return value has: Number string Boolean object undefined function
8. Forced type Conversion
parseint () parsefloat () number () toString ([parameter])
Eval () (converts a string to an expression and outputs the value of an expression)
IsNaN () determines non-numeric, if the parentheses are non-numeric, the value is true otherwise false
9, the three main structure of the program
Sequential selection Loops
10, JS in the Boolean environment, the following represent true and false two kinds of situations
A: All numbers are true, 0 is False
B: All strings are true, empty strings are false
C:null and undefined are false.
D: All objects are true
11. Multi-branch switch and if usage scenarios
When the general condition is a range, you can use the IF
When the general condition is a specific value, using switch can improve efficiency
12. For and while usage scenarios
When defining the number of cycles, it is recommended to use the for
It is recommended to use While/do...while when the number of cycles is unclear
JS Basic knowledge 1