Home>Article>Web Front-end> js basic knowledge
Basic concepts of js
Local variables and global variables of js
js The data type
var is a weak data type, but js can recognize its data type
About js methods
Writing of methods
Method coverage
Unlike Java, there is no duplication of methods in js Load, only method override
as long as the method name is the same. No matter how many parameters there are, js will only recognize the last method (method override)
js data type conversion
Although js only A var is used to describe a variable (weak data type), but the system can identify its data type and can also perform data type conversion
Operation calculations in js
The operation rules of js are the same as Java (but special attention: x= y)
function abc(){ var a='10'; var b='8'; console.log("b的值 "+b+" b的数据类型转换成 "+typeof(b)+" "+a) /* =+ a先转换成number 再给a的值复制给b */ /* += 等价与 b+=a == b=b+a */ }
Select statement and loop statement
Omitted: Same as java
js main object
window object
Time intervaler
Use of array
Basic operations on strings
Formatting of js time
Recommended tutorial: "JS Tutorial"
The above is the detailed content of js basic knowledge. For more information, please follow other related articles on the PHP Chinese website!