方法2如何给数组赋值i+j?
使用for循环:
<script type="text/javascript">
var myarr=[[0,1,2][0,1,2,3,4,5]];
for(i=0; i<myarr.length; i++){
for(j=0; j<myarr[i].length;j++){
myarr[i][j]=i+j;
}
</script>