- <html>
- <head>
- <title>
- start!
- </title>
- <script type = "text/javascript">
- function ForIn(){
- this.for = 1;
- this.in = 2;
- }
- </script>
- </head>
- <body>
- <h3>zhangnanshishabi!</h3>
- <script type = "text/javascript">
- var forin = new ForIn();
- for(var x in forin)
- alert(x+forin[x]); //这里如果不是forin[x],是forin.x的话,会返回未定义
- </script>
- <body>
- </html>