Re:Do you really know JavaScript?
by gcommer on Friday January 31, 2014 @06:02PM
(#7159756)
The author of this quiz could have made this a great learning opportunity by linking to the appropriate sections in ECMA-262[0].
For example, question 15 makes a lot more sense when you read "ToBoolean" (Sec 9.2) which shows that all objects (including arrays) are always considered truthy values, however when compared with ==, "The Abstract Equality Comparison Algorithm" (11.9.3) is used, which gives this behavior:
For example, question 15 makes a lot more sense when you read "ToBoolean" (Sec 9.2) which shows that all objects (including arrays) are always considered truthy values, however when compared with ==, "The Abstract Equality Comparison Algorithm" (11.9.3) is used, which gives this behavior:
because a shallow comparison is used.[0] http://www.ecma-international.org/publications/files/ECMA-ST...