全局变量未显示在webpack中

时间:2017-02-17 16:30:17

标签: javascript webpack

当我使用webpack时,我的全局变量无效。知道为什么吗?

var s = {
  name : 'Goku',
  fn : function(){
    return this.fn2.bind(window)();
  },
  fn2 : function(){
    return this.x;
  }

};

var x = 45;
console.log(s.name);
console.log(s.fn());  should say 45 since it's rebinded. getting undefined

0 个答案:

没有答案