DEV Community

Discussion on: Everything Wrong With JavaScript `eval()`

Collapse
 
drewswaycool profile image
Drew McMurry

I'm running into an issue where I keep getting, Unexpected token 'const'

Collapse
 
maxprogramming profile image
Max Programming

I think it's because you are using const in the string.
In the expression, you are returning an expression. You cannot return a const. Just pass in a simple expression like 2+5 or something like a ternary operator