2 ms·
How does that clobber the global object? Are you talking about `function clearInterval()`? That doesn't go into the global scope. > let foo = function bar(
by Zarel 10y ago
How does that clobber the global object? Are you talking about `function clearInterval()`? That doesn't go into the global scope.
> let foo = function bar() {}
undefined
> bar
ReferenceError: bar is not defined
- agency 10y agoIt doesn't overwrite the function on the global scope, but it does shadow the `clearInterval` name within the function definition, which I don't believe it should do according to the ES6 spec. Compare: https://buble.surge.sh/#class%20A%20%7B%0A%20%20clearInterval()%20%7B%0A%20%20%20%20console.log(this.clearInterval%20%3D%3D%3D%20clearInterval)%0A%20%20%7D%0A%7D%0A%0Anew%20A().clearInterval() https://buble.surge.sh/#class%20A%20%7B%0A%20%20clearInterva... with https://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015%2Creact%2Cstage-2&experimental=true&loose=false&spec=false&code=class%20A%20%7B%0A%20%20clearInterval()%20%7B%0A%20%20%20%20console.log(this.clearInterval%20%3D%3D%3D%20clearInterval)%0A%20%20%7D%0A%7D%0A%0Anew%20A().clearInterval() https://babeljs.io/repl/#?babili=false&evaluate=true&lineWra...