Category :
Published on :Mar 17, 2016
Do you remember we talked about ruby's send method [here]({{ site.url }}/using-send-method-in-ruby-to-refactor-conditional/). It is used to call a ruby function from string having same value as function name.
There is js equivalent of the same:
// defining the function
var apple = function(){
console.log('apple');
}
eval('apple()') // => apple
Reference:
Loading