日期:2014-05-16  浏览次数:20527 次

js中for in输出数组中属性名和属性值
<html>
<head>
	<script>
		var person = {
			name:"suesunna",
			age:22,
			love:"coding"
		};
		
		for(var i in person){
			document.write("this person's "+i+" is "+person[i] +"<br/>");
		}
	</script>
</head>

<body>
</body>
</html>

1楼fhqcc07014天前 13:47
这么简单的东东也发表,初学者