次のような関数内に for ステートメントがあります。
for(i=0;i<=nc;i++){
var nd = //how many times this for statement has run+1
//if the for statement runs for the first time nd would be 1, second time nd would be 2, the for statement will run a total of "nc" times
this.id=nd }
どうすればこれを達成できますか?