I have a single page application that has back navigation via a back link shown at the top of the page. Each screen of the application has it's own function, I store the function name and parameters in arrays and have an event listener which uses the JS window function to call the function.
prevPage="showPage1";
prevParm=['a','b'];
prevParm1=("a","b");
prevParm2='a,b';
prevParm3=("a","b","c");
//window["navHelper"][prevPage](prevParm);
//window["navHelper"][prevPage]("a","b"); // works
//window["navHelper"][prevPage]["a","b"];
window["navHelper"][prevPage](prevParm3);
showPage1 is a function within the navHelper class
This works for a single parameter but not where there are multiple parameters.
How do I pass two parameters to function using window? I tried passing an array and various other methods and can't get it to work.
There is a jsfiddle showing the issue here: https://jsfiddle.net/zacmarshall/j6Lxa0u1/3/