Home>Article>Web Front-end> js basic knowledge

js basic knowledge

hzc
hzc forward
2020-06-08 16:26:52 2159browse

Basic concepts of js

Local variables and global variables of js

js basic knowledge

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 */ }

js basic knowledge

Select statement and loop statement

Omitted: Same as java

js main object

window object

Time intervaler

 

js basic knowledge

Use of array

     

js basic knowledge

Basic operations on strings

   

js basic knowledge

Formatting of js time

    

js basic knowledge

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!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete