请老师检查一下代码
来源:2-7 编程练习
慕数据5191420
2022-04-16 17:19:41
<!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].toUpperCase(); break; } } console.log(arr) </script> </body> </html>
1回答
好帮手慕小李
2022-04-16
同学你好,代码可以实现需求,棒棒的!继续努力,祝学习愉快!
相似问题