On Tue, Jan 11, 2011 at 8:35 AM, Adrian Olaru <[email protected]> wrote:
> or you just write undefined instead of void(0) or void 0. Minor fyi: While true, do note that in most cases, this incurs a (minor!) overhead for lookup (because undefined is actually a global variable) while void(0) is an operator and doesn't have this overhead. (The security issue was already addressed by Matthias.) Note that you could compare undefined with null using "weak" comparison (==). In this tool ( http://jscoercion.qfox.nl ) you can see that only (the real) undefined and null will result in true, when compared to something that should be undefined (or null ;). And I think `null` is cleaner than `void(0)`. But note that it won't be equal in strict comparison (===). - peter -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
