How can I set a global variable from inside a JavaScript function, using the function's parameter to name the global variable itself? For example:
function loadLog(id){
window.id = "test";
}
So if the function was called like this...
loadLog('apple');
...then the global variable created by it would have the name "apple" with the value of "test."
I have no idea what to do and how to accomplish this. I've tried searching, but came across nothing.