From the documentation on LiveScript, here's their reasoning for using void
rather than undefined
:
In JavaScript, undefined can be redefined, so it is prudent to use the
void operator which produces the undefined value, always. void at the
top level (not used as an expression) compiles to nothing (for use as
a placeholder) - it must be used as a value to compile.
As for the 8
, it's an arbitrary number, and could have been set to any other. As per discussion in the comments below, the reason for this particular arbitrary number is because LiveScript is a fork of coco, whose wiki reports:
void 8 - the number 8 was chosen because it is a Chinese lucky number.
Regardless of how the developers chose the value, broadly speaking, it's just what the LiveScript void
compiles to. There just has to be some expression evaluated by the void
call.