On Thu, Mar 17, 2011 at 6:23 PM, Peter van der Zee <[email protected]>wrote:
>
> When you want to create functions depending on some factor (so inside an
> if), as far as the specification goes, you can only use function expressions
> (var f = function ...).
>
> So, recap:
>
> function f(){} // var f is hoisted and will contain the function
>
> var f = function(){}; // var f is hoisted but the function value is NOT
> var f = function g(){}; // var f is hoisted but the function value is NOT.
> var g should not be hoisted, or even exist, because it should only exist
> inside the function.
>
> Hope this helps... :)
>
> - peter
>
Thank you for the clarification Peter. That is quite interesting.
- shaun
--
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]