上QQ阅读APP看书,第一时间看更新
TypeScript classes generate closures
The JavaScript as shown previously is actually the output of the TypeScript class definition. So, TypeScript actually generates closures for you.
Adding the concept of classes to the JavaScript language has been talked about for years, and is currently a part of the ECMAScript 6th Edition. Microsoft has committed to follow the ECMAScript standard in the TypeScript compiler, as and when these standards are published.