javascriptvara={data:[{title:'标题1',index:0},{title:'标题2',index:1},{title:'标题3',index:2},{title:'标题4',index:3}]};varb=a.data;varc=[];varcurrent=2;for(variinb){if(i!=current){c.push(b[i]);c[(c.length-1)].index=c.length-1;}}console.log(c);console.log(a);上面一段代码里面为什么在对象a中标题4对应的index值变成了2另外,如果想不该变a的值应该怎么做
添加回答
举报
0/150
提交
取消