js中this关键字

xiaoxiao2021-02-28  133

<html> <head> <title>011</title> <script type="text/javascript" charset="utf-8"> //this:this对象是指在运行时期基于执行环境所绑定的 //this总是指向调用在 /* var k=10; function test(){ this.k=20; } //window.test(); test();//全局作用域内调用这个函数,它是调用者。 //alert(test.k);//undefined alert(window.k);//20 alert(k);//20 */ </script> </head> <body> </body> </html>
转载请注明原文地址: https://www.6miu.com/read-1950319.html

最新回复(0)