为什么`this`总是在构造函数中的`Window`对象?

ben*_*e89 1 javascript

我有这个代码:

(function() {

  function App(elements, options) {

    if (!this instanceof App) return new App(elements, options);

    var that = this;

    return this;

  }

  window.App = App;

})();

App(document.querySelectorAll('.Slider-slide'), {
  interval: 5000
});
Run Code Online (Sandbox Code Playgroud)

我的问题是,它永远不会创建一个新的实例App,所以,this进一步下来的代码总是Window对象,任何想法为什么??