That's equivalent to no check at all.
If it weren't for the initialization and final (end-of-loop) expressions, it would be like while (true) { yield current; }
From MDN - for
statement (emphasis mine):
condition
An expression to be evaluated before each loop iteration. If this expression evaluates to true
, statement is executed. This conditional test is optional. If omitted, the condition always evaluates to true
. If the expression evaluates to false
, execution skips to the first expression following the for construct.
To understand the purpose of that function, you'd have to look into the yield
keyword. An example of usage would be:
var p = powers(2);
console.log(p.next()); // 2
console.log(p.next()); // 4, 8, 16 and on...