سؤال

Say I have these variables

var word1 ='wordA';
var word2 ='wordB';
var word3 ='wordC';
var word4 ='wordD';
var word5 ='wordE';

and I have this loop

for (var i=1; i<6; i++) {
    // make word + i = ''; (an empty string)
}

how would I go about doing so using Actionscript 2?

هل كانت مفيدة؟

المحلول

Try this:

for (var i=1; i<6; i++) {
    this[ "word" + i ] = ''; (an empty string)
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top