1 Answer
1

Without a string, the code is already evaluated at a lower level, namely before it is passed to eval (e.g. your last statement is just doing eval(6)). That's the case for any function; it's how JavaScript code is evaluated. eval is not magical in that sense because it's "just" a function that "just" accepts an argument.

What eval should return when am expressions is passed that is not a string is described in the specification: