Re: [JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-10 Thread Dmitry A. Soshnikov
Yep, thanks Angus Regarding FEs - FDs, personally for casual helper procedures I use FDs I usually use FDs. E.g.: // library (function (global) { function format(data) { /* code */ } function isCorrect(x) { /* implementation */ } var thirdHelper = (isCorrect(10) ? fun

[JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-09 Thread Angus Croll
Sure I could have phrased it better :-) I guess my point is having a function assigned to a property or variable makes the syntax consistent with other objects assignments. Contrast with Java, for example, where a function is a second class object and cannot be freely assigned - in that case an FD

[JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-09 Thread DaveC
@Diego Perini: Right, yeah, duh... I get it, me being thick (again)... variable instantiation (declaration) versus code execution (assignment). On Feb 9, 8:06 am, Juriy Zaytsev wrote: > On Wed, Feb 9, 2011 at 1:44 AM, Angus Croll wrote: > > Very nice article Dmitry. I share your philosophy of "

Re: [JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-09 Thread Juriy Zaytsev
On Wed, Feb 9, 2011 at 1:44 AM, Angus Croll wrote: > Very nice article Dmitry. I share your philosophy of " more important > to understand the mechanics than judge it good or bad" > > Side note about FEs. I normally prefer over FDs, partly because they > make top down reading more intuitive but m

[JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-08 Thread Angus Croll
Very nice article Dmitry. I share your philosophy of " more important to understand the mechanics than judge it good or bad" Side note about FEs. I normally prefer over FDs, partly because they make top down reading more intuitive but mainly, I think, because they illustrate that in JavaScript fun

Re: [JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-08 Thread Diego Perini
On Tue, Feb 8, 2011 at 2:50 PM, DaveC wrote: > Asen Bozhilov: > > Yeah, the point I was trying to make is that it's not a standard > behaviour and yes each of the engines don't throw a SyntaxError - I > think they should because (apart from Mozilla's), what they do is not > the behaviour I would h

[JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-08 Thread DaveC
Asen Bozhilov: Yeah, the point I was trying to make is that it's not a standard behaviour and yes each of the engines don't throw a SyntaxError - I think they should because (apart from Mozilla's), what they do is not the behaviour I would have expected. I agree that mozilla's engine behaves almo

Re: [JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-08 Thread Dmitry A. Soshnikov
Yep, thanks, I aware about FSs. For the complete and detailed explanation you may check "ES3. Ch5. Functions." http://dmitrysoshnikov.com/ecmascript/chapter-5-functions/ (where all this stuff -- FD, FE, NFE, FS, etc is discussed in detail). FYI: ES6 (Harmony) will standardize FSs. So currently

Re: [JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-07 Thread Asen Bozhilov
DaveC: > I think it worth a further nod wrt function statements inside of a > block statement. I agree. My example was to show how can FunctionStatement can be confused with FunctionDeclaration and that lead more confusion in the reader. > ECMAScript allows syntactic extensions, one such extensio

Re: [JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-07 Thread Lasse Reichstein
On Mon, 07 Feb 2011 22:18:02 +0100, DaveC wrote: I think it worth a further nod wrt function statements inside of a block statement. ECMAScript allows syntactic extensions, one such extension is to allow function statements inside of a block statement currently Mozilla is the only vendor (*I

[JSMentors] Re: Note 4. Two words about "hoisting".

2011-02-07 Thread DaveC
I think it worth a further nod wrt function statements inside of a block statement. ECMAScript allows syntactic extensions, one such extension is to allow function statements inside of a block statement currently Mozilla is the only vendor (*I think*) that has added this extension - so I would adv