arr=[1,2,3];
function modi(str){
switch(str){
case 1:
str = "a";
break;
case 2:
str = "b";
break;
case 3:
str = "c";
break;
}
}
modi(arr[0]);
modi(arr[1]);
modi(arr[2]);
console.log(arr);//返回 1,2,3
要怎样才能返回 a,b,c
牧羊人nacy
红颜莎娜
随时随地看视频慕课网APP
相关分类