Many programmers say it is a bad practice to use the eval() function:
When is JavaScript's eval() not evil?
There's a research publication exacty on this topic:
The Eval That Men Do -- A Large-scale Study of the Use of Eval in JavaScript Applications
Mirror on Wayback Machine
It is to me the most comprehensive answer to this question to date.
Quote from the abstract:
We have recorded the behavior of 337 MB of strings given as arguments to 550,358 calls to the eval function exercised in over 10,000 web sites.
Amongst other, they identified 9 categories of recurring eval:
A snippet from the conclusion (which is too long to be quoted entierly):
[...] While many uses
evalwere legitimate, many were unnecessary and could be replaced with equivalent and safer code. We started this work with the hope that it would show thatevalcan be replaced by other features. Unfortunately our data does not support this conclusion.[...]
A paper well worth reading.