麻烦老师检查一下,谢谢

来源:2-7 编程练习

郫县陈冠希

2022-03-02 22:21:22

<!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 (value == 'o') {
        arr[index] = value.toUpperCase()
        break;
      }
      // if (index == 2) {
      //   arr[index] = value.toUpperCase()
      // }
    }
    console.log(arr);
  </script>
</body>

</html>
           
下载视频          
写回答

1回答

好帮手慕星星

2022-03-03

同学你好,代码实现效果很棒。继续加油,祝学习愉快!

0

0 学习 · 17877 问题

查看课程