深度学习 天池新闻文本分类比赛指导班(NLP方向)
2022-10-29 00:02 作者:janet19961217 | 我要投稿
示例一
'use strict'function fn( a, b ){
console.log( this )}fn( 1, 2 )
上述中的 this
会打印出什么呢?
fn( 1, 2 ) === fn.call( undefined, 1, 2 ) === fn.apply( undefined, [1, 2] )
答案
严格模式 ==>
this === undefined
非严格模式 ==>
this === undefined == 浏览器转化 ==> window