💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ // 箭头函数与普通函数的区别是什么,构造函数可以使用new生成实例,那么箭头函数可以吗?为什么? ~~~ ![](https://img.kancloud.cn/49/fc/49fc7780e6c2837e8e67a287b3faa0b4_1137x85.png) ![](https://img.kancloud.cn/6e/5e/6e5e841c946f770ac83b2958541cf717_1116x367.png) ~~~ let obj = { name:'ov' }; function fn1() { console.log(this); } fn1.call(obj); // obj let fn2 = ()=>{ console.log(this) // this是所属上下文,window }; fn2.call(obj); //window ~~~ ![](https://img.kancloud.cn/3e/bb/3ebbb5a96a565e10eb0fd4f150c0d6aa_828x85.png) ![](https://img.kancloud.cn/c6/01/c601f517cc9a5a8099b417b3cd3791b6_591x109.png) ![](https://img.kancloud.cn/46/d1/46d17fe8e6414aacb6e2f9298a3c8970_770x353.png) ![](https://img.kancloud.cn/20/22/20228deb72c1804117f0819f24169727_1108x586.png) 1 ![](https://img.kancloud.cn/89/dd/89ddd4c9664e80ad4a1dd8b88b50c144_1124x227.png) 2 ![](https://img.kancloud.cn/cf/87/cf876d7918d773f690a96c7a087c430a_1160x196.png) 3. ![](https://img.kancloud.cn/f5/99/f5997d444367d2143f21a9efa0a4d9d7_647x313.png) ![](https://img.kancloud.cn/b9/a1/b9a11acb3f18d254ae96833eb9660866_1077x449.png)