for in loop over javascript associative array
<script type="text/javascript"> var a = {"k1":"v1", "k2":"v2"}; for (key in a) { if (a.hasOwnProperty(key)) { document.write(key + "=" + a[key] + "<br/>"); } } </script>
for in loop over javascript DOM object
<script type="text/javascript"> var obj = window.screen; for (key in obj) { document.write(key + "=" + obj[key] + "<br/>"); } </script>