This is due to the nature of the function eval. Note:
var i = 0, j = while(i < 5) { i++; };
Compiles. Nonetheless,
var i = 0, j = eval('while(i < 5) { i++; }');
Assigns a value 4 j. Why is this? Quote from MDN :
eval() returns the value of the last evaluated expression.
, console.log , eval -ed, i++.