First, I concede to the empirical evidence disproving my assertion that the
expression was hoisted. I have been shown the light (in a way such that it
has spoken unto mine own understanding) and I now believe. Thanks Geerten.
This is why the paren placement boggles me:
42.toString() // Errorinated
(42).toString() // Successified
(42.toString()) // BELETED
I would expect the same behavior here
function () {} ().toString()
(function () {}).toString()
(function () {}.toString()) // WORKS !?!?!
That's why I find it odd that the placement of the parens is unimportant.
I don't know what the spec says about it, but the behavior appears
inconsistent and therefore unintuitive.
AJ ONeal
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.