内置对象:
Date
new Date() --->系统当前时间
var d=new Date()
d.getFullYear()
getMonth()
getDay()
getDate()
getHours()
...
toLocalString() --->2018/08/20 12:09:12
string
charAt(index)
charCodeAt(index)
indexOf(字符)---》位置
lastIndexOf(字符)
substr(start,length)
substring(start,end)
toUpperCase()
toLowerCase()
...
Math
Math.abs()
Math.random() [0,1)
Math.floor()
Math.ceil()
Math.round()
Math.pow(2,2)
Math.sqrt(4)-->2
属性:
length
Array:
定义:
var arr=[]
var arr=new Array()
添加:
arr[0]='aaa'
arr.push('aaa')
arr.splice(2,0,'aaa','bbb')
删除:
pop()
shift()
属性:arr.length
BOM模型:browser object model
window对象:
属性和方法
属性:
innerWidth
innerHeight
outerWidth
outerHeight
方法:
alert() --->警告对话框 window.alert() alert()
confirm() ---> 确认对话框 true false
prompt() ---> 输入对话框 null ,
open("xxx.html")
close()
setInterval ---》每隔 循环做动作
clearInterval ---》利用setINterval的返回值
setTimeout ----》xx时间后做一次动作,如果实现循环动作使用递归
clearTimeout ----> 1.阻止的递归 使用flag=false|true 2.利用的setTimeout的返回值结束