OOP in Javascript(4)

来源:互联网 发布:python spark 编辑:程序博客网 时间:2024/05/21 21:33

 

  • Objects as associative arrays
  1.     <script language="javascript" type="text/javascript">
  2.     <!--
  3.     testObj = {
  4.     prop1:"hello",
  5.     prop2:"hello2",
  6.     prop3:new Array("helloa",1,2)
  7.     }
  8.     for(x in testObj)
  9.         alert(x + "-" + testObj[x]);
  10.     
  11.     
  12.     
  13.     //-->
  14.     
  15.     </script>
原创粉丝点击