Front-end technology (JavaScript) study notes (3) String Date Number Math Array and regular expressions

1. Commonly used objects in Javascript

①、字符串类型(String)
常用方法如下:
anchor()
charAt()
charCodeAt()
concat()
indexOf()
lastIndexOf()
link()
replace()
search()
split()
substring()
toLowerCase()
toUpperCass()
toString()
②、Date
var strNow=now.getFullYear()+”-“+(now.getMonth()+1)+”-“+now.getDate()+” ”+now.getHours()+”:”+now.getMinutes()+”:”+now.getSeconds();
常用方法如下:
getFullYear()
getMonth()
getDate()
getHours()
getMinutes()
getSeconds()
③、Math
abs()
sqrt()
pow()
reverse()
floor()
ceil()
max()
min()
round()
random()
④、Array Pay attention to the creation of arrays and the traversal of array elements.
Common methods are as follows:
concat()
join()
pop()
push()
reverse()
sort ()
⑤、Number
Pay attention to the conversion of Number->String and
String->Number

write picture description here

write picture description here

⑥, the application of regular expressions, verification of user ID, login password, email, phone and other format requirements

write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325939606&siteId=291194637