Change the name of variables within a for loop

Change the name of variables within a for loop

I have created a for loop that creates variables with the same name but different numbers (e.g. value1, value2, value3...), populates those variables and then prints them. I have no issues with the script itself as it is working as expected when using Visual Studio. I am using the "window" object command and when I try to use it in Tago, I get an error saying "window is not defined". How can I use the "window" object in Tago? The command line that executes this is "window["data"+i] = new Object(filter);". Thank you in advance.