📌  相关文章
📜  'this' 的外部值被此容器遮蔽 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:19.394000             🧑  作者: Mango

代码示例1
In TypeScript (and ES6) exists two kinds of functions: The classic function declaration and the arrow function. Where the classic function declaration has the default floating binding logic for the this keyword - the arrow function will constantly use the value for this of the context containing the arrow function. In the example this will be the instance of the surrounding class.