+ 2
Why use eval in Javascript challenges yet it's not recommended to be used?
In Javascript challenges have noticed the use of eval function n yet it's not recommended. This is bad for learners as they will resort to using the function.
4 ответов
+ 12
why is using eval so bad?
eval is a very powerful function. There are times where it's perfectly appropriate.
The problem is that no tutorial really shows how and when to use it.
+ 12
well, I've not played JS in quite some time and I don't know the quizzes you are talking about, but sometimes quizzes in general show bad practices in order to demonstrate why they are bad... I agree with Kamil - eval is powerful, but one thing you should never do with it is to run it with user's input, without checking what the input holds 😉
+ 8
@Nikolay just like python's eval()