my previous question about this dealt with global vars
but unfortunatley the window
of opportunitys doesn't work with this next example because it alerts 4 times instead of only 1
test("a","b","c");
function test(var0,var1,var2,var3) {
for(var i=0; i<4; i++) {
if(window["var"+i]===undefined) {alert("test");}
}
}
this may not be very clear so I will try again
this time I want it to alert all three vars
test("a","b","c");
function test(var0,var1,var2) {
for(var i=0; i<3; i++) {
alert(window["var"+i]);
}
}
how can I achieve the identical results as with the window["str"+var]
from within a function?