请老师看有什么需要改进的

来源:3-29 编程练习

慕无忌1117323

2018-01-17 10:59:12

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>toUpperCase和toLowerCase</title>
</head>
<body>
<script>
    var str="Never deter till tomorrow that which you can do today";
    var index=str.substr(17,8);//补充代码
     var strNew=index.toUpperCase();//补充代码
     var upperStr=str.replace("tomorrow",strNew)//补充代码
document.write(upperStr);
</script>
</body>
</html>


写回答

2回答

ifxi

2018-02-02

 var upperStr=str.replace("tomorrow",strNew)//补充代码

你这句 "tomorrow" 应该替换一下

var upperStr = str.replace(index, strNew);//补充代码


0

Miss路

2018-01-17

写的没有问题,就这几行代码没有什么太多的可优化空间,以后代码写的多了自己就能总结出来了。继续加油!

0

0 学习 · 36712 问题

查看课程