xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

JavaScript this All In One

js, this, bind, call, apply, new, function, arrow function, constructor function, class

  1. this in a global context

golbalThis


https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis

https://stackoverflow.com/questions/57157864/what-is-globalthis-in-javascript-what-will-be-the-ideal-use-case-for-this

  1. this in object construction

  1. this in an object method

  1. this in a simple function

  1. this in an arrow function

  1. this in an event listener

  1. this in a class

refs

https://zellwk.com/blog/this/

https://github.com/zellwk/z

https://github.com/zellwk/zellwk.com/blob/master/src/posts/2017-06-21-this.md



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


原文地址:https://www.cnblogs.com/xgqfrms/p/13834168.html