Within Javascript, you can create and call a function as such:
function test_1(){ console.log(1); }
window['test_1']() // --> 1
However, my current code is scoped:
(function(){
function test_1(){ console.log(1); }
window['test_1']() // --> not a function
})();
...making any created functions not be bound to the window-level, but to the specific scope level.
How can I create a function within a scope, and then dynamically* call that function?
*By dynamically I mean that I can dynamically alter the string with a variable, such as window['test_'+index]().