What is eval?

Asked: Apr 14, 2023

The eval() function evaluates JavaScript code represented as a string. The string can be a JavaScript expression, variable, statement, or sequence of statements.
console.log(eval('1 + 2')); // 3

Asked by brijesh

Answers (0)

No answers yet. Be the first to answer!