请老师检查
来源:2-7 编程练习
Cynthia4660559
2022-03-21 20:36:14
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<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 [key,item] of arr.entries()) {
if (item=='o') {
arr.splice(key,1,'O');
break;
}
}
console.log(arr)
</script>
</body>
</html>1回答
好帮手慕慕子
2022-03-22
同学你好,代码实现是正确的,继续加油,祝学习愉快~