请检查谢谢

来源:2-7 编程练习

张小阳_

2022-10-19 23:37:32

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

</html>


写回答

1回答

好帮手慕星星

2022-10-20

同学你好,代码是正确的。继续加油,祝学习愉快!

0

0 学习 · 17877 问题

查看课程