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
相关文章
相关标签/搜索