javascript中的函数有全局和局部作用域吗?function doSomething() function foo() alert(this);}在这里,函数foo()没有被执行。但是函数中的"this“关键字指向全局窗口对象,如果函数doSomething()是executed.That,则表示函数foo()在全局作用
ProjectBox.prototype.printMember = function ( params ) { app.js:1145 Uncaught TypeError: this.printMember is not a function 我读到箭头函数不需要使用.bind(这)来解决作用域问题,但我甚至将代码修改为匿名函数并执行绑定,但仍然存在相同的问题。