JS if语句 赋值判断

2024-06-24 12:39 JS if语句 赋值判断已关闭评论
<script>
var i;
var cars = new Array();
cars[0] = "Saab";
cars[1] = "Volvo";
cars[2] = "BMW";
cars[3] = "";

for (i=0;i<cars.length;i++)
{
	if (cars[i]== ""){
	cars[i] = "BMWree"};

document.write(cars[i] + "<br>");
	
}
</script>
版权声明:本文著作权归原作者所有,欢迎分享,谢谢支持!
转载请保留注明:JS if语句 赋值判断 | DPIP知识库
分类:JavaScript 标签:

评论已关闭!