hehehehehe000
hehehehehe000
2017-07-16 03:56

字符串替换问题,不会替换

  • javascript

把字符串“javascript is awesome”替换成“j4v4scr1pt 1s 4w3s0m”
var input="javascript is awesome";
var output="";
for(var i=0;i<input.length;i++){
output+=input[i];
output["a"]=["4"];
output["o"]=["0"];
output["i"]=["1"];
output["e"]=["3"];
}

console.log(output)
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

6条回答

为你推荐

换一换