BOM--Browser object model(瀏覽器對象模型)瀏覽器
1,window.open(url,ways) url:打開的網頁地址; ways:打開方式-self;-blankapp
2,window.close()函數
3,window.navigator.useragent 瀏覽器用戶信息this
4,window.location 瀏覽器地址信息url
5,window.history 記錄瀏覽器的訪問歷史記錄spa
window.history.forward() 前進(最新的訪問記錄)對象
window.history.back() 返回繼承
函數的解析:原型鏈
函數若是把他當作函數看,就只能起到函數的意思,能夠封裝原型
若是咱們把函數當作對象來看,就能夠實現一些繼承了
dir(fn)
能夠發現原型鏈上函數對象天生自帶call();apply();bind()
這三個方法改變this指向(函數內)
A.call(B,c,d)
B取代了A中的this,而後把B調用了
案例分析:
找出這些數字中的最大項,參數必須是數字
var arr=[11,22,34]
var s=Math.Max.apply(null,arr)
console.log(s)