I heard a lot of different opinions about eval () and I'm a little unsure if using eval () in this context:
let's say I have an object like this:
var bla = {
blubb: function (callback) {
}
}
And a line like this:
var someString = "bla.blubb";
Is it an evil value to evaluate a string to call a function (and a callback)?
var callMe = eval(someString)
callMe(function(){
alert('yay')!
});
source
share