You are reading a single comment by @allObjects and its replies.
Click here to read the full conversation.
-
this as a source wastes 4 bytes
well unless the source is tokenized https://github.com/espruino/Espruino/blob/master/src/jslex.h#L78
_
is just an identifier likea
orA
. There was - and still is the convention to name private things w/ a leading_
. _... means to leave it alone except you defined it in your scope.I often use it
var _=_||this;
before a closures and as a space saver. The || is there to mess with the minifier in a good sense: if you use justvar _ = this;
, minifier tracks 'you' down and replaces the_
references in the code back tothis
, and - exactly - it is what you just tried to get away from...). Because Espruino interprets off the source,this
as a source wastes 4 bytes... and if it shows often, it eats into the variables space.