JavaScript
JavaScript 数据类型
对象属性有两种寻址方式
源代码:
点击运行 »
<script> var person = { firstname: "John", lastname: "Doe", id: 5566 }; document.write(person.lastname + "<br>"); document.write(person["lastname"] + "<br>"); </script>
运行结果:
点击运行 »