jquery call function from string variable

I'm editing the main post, originally I was checking a way to dynamically call function name beginning from a couple of strings. Specifically I had a prefix and a variable string based on a text list. Actually I get this words by a table, my purpose is create filters for the datatable jquery object. However I solved with the eval method like this:

var fn = 'my_foo';
eval(fn+'()');

I really have to say I thought to have fixed my issue, but eval is a bad practise for security risks and majorly I'm still not able to test if dynamic function name exists. I have tried $isFunction, window[myname], typeof myname === 'function', nothing of the constructs above works. I also have tried $ instead of window since I'm using jquery and webpack. I'm driving crazy please help.

1 answer

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum