请老师检查
来源:2-32 编程练习
qq_o張i亽_0
2018-09-19 18:16:24
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>splice</title>
</head>
<body>
<script>
//补充代码
var a=[],i=0,s;
while(s!=-1){
s=prompt('请输入')
if(s==-1){
break;
}
a[i]=s;
i++;
}
a.splice(0,2,'hello','hello');
document.write(a);
</script>
</body>
</html>
2回答
好帮手慕糖
2018-09-23
你好,如下,这里少了一个加号哦。
若能帮助到你,望采纳。
祝学习愉快!
好帮手慕糖
2018-09-19
你好,经测试,实现效果没有问题,继续加油!
祝学习愉快!