I know that 'this' is different outside and inside the closure.But why are numChildren and this.numChildren different inside closures?Or why is numChildren the same outside and inside?
var _this:Sprite = this; trace("[outside]this: " + this); trace("[outside]numChildren: " + numChildren); trace("[outside]this.numChildren: " + this.numChildren); (function ():void { trace("[inside]this: " + this); trace("[inside]numChildren: " + numChildren); trace("[inside]this.numChildren: " + this.numChildren); trace(_this.removeChildAt === removeChildAt); trace(this.removeChildAt === removeChildAt); })();
You can see the code and output from the following linkHow do you explain this?
"this" . . . "this" , .
numChildren - , , , , "name" , . , "this", , .
this.name this.numChildren, , ,
Source: https://habr.com/ru/post/1760454/More articles:jQuery Code Assist for Eclipse - jqueryHow do I manage my NSTimer in an iPhone app in a tab? - iosJavascript and css minifier built-in in studio 2010, asp.net mvc application - javascriptWCF Identity Identification Error - c #What is the "frequency difference" that NTP is trying to synchronize? - ntpSQL Server: importing XML from a web server? - xmlXSLT 1.0: Grouping and Duplicate Removal - xsltOracle Jar triggers Maven packaging warning - oraclechanging tabstop from 4 to 2 after using expandtab (with minimal manual effort) - vim"Эта версия сервера не поддерживается. Только для Microsoft SQL Server 2005 поддерживаются" в Visual Studio 2008 Не удается подключиться к SQL Server 2008 R2 - sql-serverAll Articles