3 ms·
That is precisely what eval() is for. The downsides have to do with dumb/slow/insecure implementations and environments. You really do have to be careful, but o
by aristus 19y ago
That is precisely what eval() is for. The downsides have to do with dumb/slow/insecure implementations and environments. You really do have to be careful, but only because you are running in a hostile environment.
0) eval() is slow. Why? Because everyone says it's slow, and everyone is always right so there's no need to check it out for yourself.
1) Read up on JSON: http://www.json.org http://www.json.org They go over a lot of the issues involved.
- axod 19y agoeval isn't slow. It's fast. That's why the JSON decoder at json.org uses it. It simply makes sure the input is 'clean' - eg simple json notation data, then evals it.