-
• #2
You'd have to do some tests...
It'd be close...
this
is a reserved word, so accesses will be faster as there's no lookup.- But
_
is short, and a local variable, so parsing will be faster and lookups shouldn't be that slow either.
But
funWithLocalVariable
would probably minify much better. -
• #3
Thanks. ...somewhat as expected. Here two methods of a singleton that use local _-reference for this.:
... , d: function(e) { var _=this; ((e)?[e]:_.es).forEach(function(e){ _[e[1]+"D"].apply(_,e); }); return _; } , clr: function(cx,i) { var _=this, c; if (cx<0) { c=_.clrs[0].apply(_,_.clrs[-cx]); } else { c=cx^((i)?7:0); c=[(c&4)>>2,(c&2)>>1,c&1]; } _.lcd.setColor.apply(_.lcd,c); return _; } ...
...that's why I like 'older' virtual/late-late-binding/interpreted languages that use ^ for noisy return... ;-) ...and old new things for the dredging function: => ...and function / block w/ arguments definition: [ :a :b | ...code using local vars a, b ]. ...some 'good old times' that did not need the curly braces and parenthesis salad...
@Gordon, what's your implementation-knowing 'guess'? ...space / memory footprint, time / performance?