JavaScript:this粗解、prototype

this:當前的方法屬於誰,this就是誰,好比下面的代碼中,function是爲arr添加的,因此this就是指arr。javascript <!DOCTYPE html> <html> <head> <title>this 粗解</title> </head> <script type="text/javascript"> var arr = [1,2,3,4,5,6]; arr.a = 1
相關文章
相關標籤/搜索