Accessing 'this' in Javascript closure

前端 未结 2 823
花落未央
花落未央 2021-01-19 01:58

This is more of a sanity check than anything else. I\'ve found that when working with closures in Javascript I often use the following pattern to access the enclosing class

2条回答
  •  囚心锁ツ
    2021-01-19 02:05

    This is the commonly accepted pattern with the exception that that is often used instead of self.

提交回复
热议问题