Re: [JSMentors] What are the alternatives to var self = this?

2011-03-04 Thread Nick Morgan
On 3 March 2011 19:20, Michael Geary m...@mg.to wrote: Personally I like to use the same name for the object that I would typically use in code that *uses* the object. For example I might use a variable called 'dialog' for one of your Dialog objects, both in the constructor and elsewhere.

Re: [JSMentors] What are the alternatives to var self = this?

2011-03-04 Thread Peter van der Zee
http://www.aminutewithbrendan.com/pages/20110303 On Fri, Mar 4, 2011 at 11:07 AM, Nick Morgan skilldr...@gmail.com wrote: On 3 March 2011 19:20, Michael Geary m...@mg.to wrote: Personally I like to use the same name for the object that I would typically use in code that *uses* the object.

Re: [JSMentors] What are the alternatives to var self = this?

2011-03-04 Thread Jarek Foksa
Woah, thanks for fast replies. I wasn't aware that there are so many ways to do this in JS. Do you know whether using .bind(this) has any significant performance advantage over other techniques in browsers that support ECMAScript5? -- To view archived discussions from the original JSMentors