说我有这些变量
var word1 ='wordA';
var word2 ='wordB';
var word3 ='wordC';
var word4 ='wordD';
var word5 ='wordE';
我有这个循环
for (var i=1; i<6; i++) {
// make word + i = ''; (an empty string)
}
我将如何使用Actionscript 2进行此操作?
答案 0 :(得分:2)
尝试this
:
for (var i=1; i<6; i++) {
this[ "word" + i ] = ''; (an empty string)
}