Reputation: 8963
I am trying to create
window1 = Ext.create('Ext.window.Window', {
then
window2 = Ext.create('Ext.window.Window', {
and so on
I want them to be created in the for
loop that I already have but the standart dynamic variable names for JavaScript didn't work, probably because it wants me to write new
or may be something to do with global scope, I don't know.
Upvotes: 0
Views: 494
Reputation: 10148
It's not really clear what you are asking, what's wrong with:
var myWindows = {};
for(var i=0; i<10; i++)
myWindows['win'+i] = Ext.create('Ext.Window', { /* ... */ });
console.log( myWindows.win1 === myWindows['win'+1] ) // true
Upvotes: 1