维科纳蒂 »
×
改变方向
在 Codepen 上打开
更改主题,深色/浅色
<!DOCTYPE html> <html lang='uk'> <body> <p>Видалити властивості масиву:</p> <p id="demo"></p> <script> let x = ""; const myObj = { "name":"John", "age":30, "cars": ["Ford","BMW","Fiat"] } delete myObj.cars[1]; for (let i in myObj.cars) { x += myObj.cars[i] + "<br>"; } document.getElementById("demo").innerHTML = x; </script> </body> </html>