本文档基于 CC协议(Creative Commons Share-Alike License)发布,是developer.mozilla.com, www.mozref.comwww.aptana.com共同劳动的成果。

for...in

Loops through the properties of an object.

Syntax

for (objectVariable in object){
	statement
	}

Example

for (var catProperty in cat) {
	document.write(catProperty + " : " + cat[catProperty] + "
"); //writes the name and value of the properties in cat. }