SOURCE

const o1 = {
	text: 'o1',
  fn: function() { 
  	return this.text
  }
}

const o2 = {
	text: 'o2',
  fn: function() {
  	return o1.fn()
  }
}

const o3 = {
	text: 'o3',
  fn: function() {
  	var fn = o1.fn
    return fn()
  }
}
// console.log(o1.fn())
// console.log(o2.fn())
console.log(o3.fn())

// 函数中直接定义函数并调用, 其中的this指针不属于任何一个对象, 所以这时的this指向window
// const o3 = {
//     text: 'o3',
//     fn: function () {
//         // var fn = o1.fn
//         // console.log(fn)
//         let fn = function () {
//             return this.text
//         }
//         return fn.apply(this)
//     }
// }
// window.text="skksks"
// console.log(o3.fn())
console 命令行工具 X clear

                    
>
console