维科纳蒂 »
×
改变方向
在 Codepen 上打开
更改主题,深色/浅色
<!DOCTYPE html> <html lang='uk'> <body> <h2>JavaScript Цикл For</h2> <p id="demo"></p> <script> const cars = ["BMW", "Volvo", "Saab", "Ford", "Fiat", "Audi"]; let text = ""; for (let i = 0; i < cars.length; i++) { text += cars[i] + "<br>"; } document.getElementById("demo").innerHTML = text; </script> </body> </html>