Hello World! Why everyone say eval() function is dangerous..?
I look at my code or in someone else that uses eval() function, in the comments, they will always say: âDon't use eval() function, it's dangerous! (emoji)â and I asked myself: âWhy they say eval() function is very dangerous?â I only know that eval() function can only be used to compute maths like 1+1, and others. I'm so curious that I searched it, the results are: âThey are dangerous 'cause eval() function can execute untrusted codes and âblah blah blahââ I only say to myself that eval() can only compute math problems, what's and where's scary and dangerous part of it?! ( Can you exactly explain why eval() function's so dangerous, and I will be happy if you give a code example of how and why it's scary! ;) ) All answers are appreciated