This is either a dumb question or one without an answer
I want to call a function by using an element in an array as a way to match the function name. The elements of the array are, and may need to remain string.
i.e
$(document).on('click', 'a', function() {
var classes = $(this).attr('class');
var classesArr = classes.split(' ');
arr[1]();
});
function two() { console.log('hello'); }
<a href="foo" class="one two three"></a>
obviously this doesn't work, and I get "arr[1] is not a function". But is there a trick?