麻烦老师帮忙查看并优化一下代码,谢谢~
来源:3-29 编程练习
慕粉2243585596
2020-05-13 22:17:50
<!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.indexOf("tomorrow");//补充代码
var strNew=str.substring(index,index+8);//补充代码
var upperStr=str.replace(strNew,strNew.toUpperCase());//补充代码
document.write(upperStr);
</script>
</body>
</html>1回答
同学你好,效果是正确的,代码很简洁,不需要优化了,继续加油,祝学习愉快~
相似问题
回答 1
回答 2
回答 3
回答 2
回答 1