<script>
var Thread_num=5
for(var i=1i<=Thread_numi++){
eval("var set_" + i + "=" + i)
}
alert(set_5)
</script>
2.方法1占内存,建议用数组代替
<script>
var Thread_num=5
var arr=[]
for(var i=1i<=Thread_numi++){
arr[i] = i
}
</script>
<script>
var Thread_num=5
for(var i=1i<=Thread_numi++){
eval("var set_" + i + "=" + i)
}
alert(set_5)
</script>
2.方法1占内存,建议用数组代替
<script>
var Thread_num=5
var arr=[]
for(var i=1i<=Thread_numi++){
arr[i] = i
}
</script>