JavaScript中的this的指向在函数定义时,是不确定的。只有在函数运行的时候才能确定this指向谁。this可以是全局对象,当前对象或者任意对象。取决于函数的调用方式。JavaScript中函数调用的方式如下:作为对象方法调用,作为函数调用,作为构造函数调用和使用apply,bind调用。

Continue reading

Author's picture

L G

It’s up to you how far you go. If you don’t try, you’ll never know!

Front End Developer

Beijing,China