js basic concept
js local variables and global variables
js Data type
var is a weak data type, but js can recognize his data type
About the method of js
Writing of the method
Method coverage
Different from Java, there is no method overloading in js, only method coverage
as long as the method names are the same. No matter how many parameters there are, js unity will only recognize the last method (method override)
js data type conversion
Although js only has one var to describe the variable (weak data type), the system can recognize his Data type, data type conversion can also be performed
Operation calculation in js
JS operation rules are the same as Java (but special attention: x=+y)
function abc(){ var a='#39;10'; var b='8'; console.log("The value of b "+b+" The data type of b is converted to "+typeof(b)+" "+a) /* =+ first convert a to number and then copy the value of a to b */ /* += is equivalent to b+=a == b=b+a */ }
Select statement and loop statement
Short: same as java
js main object
window object
time intervalr
Array usage
Basic operations on strings
JS time formatting
Recommended tutorial: “JS Tutorial”
The above is the detailed content of js basic knowledge, please pay attention to other related articles on 1024programmer.com for more!