6 ms·
[SPOILERS] I got tripped up by question #5 of one of the expert quizzes [1] due to a difference between ActionScript 3 and JavaScript [2]. In AS3, `(a).b` is
by strager 14y ago
[SPOILERS]
I got tripped up by question #5 of one of the expert quizzes [1] due to a difference between ActionScript 3 and JavaScript [2].
In AS3, `(a).b` is equivalent to JS's `(null, a).b`. That is, the `this` binding is lost in AS3 (but not JS). I thus thought the anser was "20, 10, 10, 10", and not "20, 20, 10, 10".
AS3 is not a superset of ES3 as most people believe.
[1] http://dmitrysoshnikov.com/ecmascript/the-quiz/ http://dmitrysoshnikov.com/ecmascript/the-quiz/
[2] I have been working on an AS3 compiler lately, which is why I mixed JS and AS3.