-1

so I'm learning js and the course I'm taking has 2 videos dedicated to the evilness of eval but not one word on why should we be tempted to use it, I don't understand why would one even use this method. can somebody elaborate on that?

I've done some Google searching but I still don't get it, everything i read mostly focuses on why we shouldn't use it rather than why would one be tempted to use this evil method lol

  • So you can run code that’s in string, eg, stored in a DB, built up dynamically, etc. – Dave Newton Aug 13 '23 at 12:39
  • One of the most popular cases must be simple arithmetic computation, like you let your user enter `"1"`, `"+"`, and `"2"` in 3 different inputs and you want to use `3` in your app from it, but similar "simple" cases are all around the web, in many variations. – Kaiido Aug 13 '23 at 13:28

0 Answers0