The for...in statement is used to loop (iterate) through the elements of an array or through the properties of an object.
循环对象的所有属性:
<script> var o = {a:'aa', b:'bb', c:'cc'}; for(var p in o) { alert(eval("o." + p)); } </script>
循环数组的所有元素:
<script> var arr = ['11', '22', '33']; for(var i in arr) { alert(arr[i]); } </script>