老师看下哪里不对
来源:3-16 编程练习
一心励志当码农
2021-05-10 10:59:41
<!DOCTYPE html>
<html>
<head lang="en">
<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.substr(index,8);//补充代码
var upperStr =strNew.toUpperCase;//补充代码
document.write(str.substring(0, index) + upperStr + str.substr(index + 8));
</script>
</body>
</html>
相关截图:
1回答
同学你好,toUpperCase是一个方法,调用方法需要添加括号,修改如下:
祝学习愉快~
相似问题