
关于js中this、原型与闭包的深入理解
1、this关键字a、有对象指向对象;b、没对象指向全局变量(window);c、有new指向new出的新对象;d、bind,call&apply改变this的指向;e、setTimeout/setInterval this指向window;f、箭头函数 this 是由函数定义时候确定的;1234567891011121314151617var adder = { base : 1,
1、this关键字a、有对象指向对象;b、没对象指向全局变量(window);c、有new指向new出的新对象;d、bind,call&apply改变this的指向;e、setTimeout/setInterval this指向window;f、箭头函数 this 是由函数定义时候确定的;1234567891011121314151617var adder = { base : 1,