请老师检查
来源:2-7 编程练习
慕斯2168053
2021-11-19 14:45:26
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
const arr = ["i", "m", "o", "o", "c"];
for (let [index, value] of arr.entries()) {
if (index == 2) {
arr.splice(2, 1, value.toUpperCase());
}
}
console.log(arr);
</script>
</body>
</html>1回答
好帮手慕小李
2021-11-19
同学你好,效果实现了没问题,但是这道题希望同学通过判断值等于o时,将其转成大写字母O,所以我们进行优化如下:

同学自己试试~祝学习愉快~