JavaScript
JavaScript 对象
这个例子创建了对象的一个新实例,并向其添加了四个属性
源代码:
点击运行 »
<script> var person = new Object(); person.firstname = "John"; person.lastname = "Doe"; person.age = 50; person.eyecolor = "blue"; document.write(person.firstname + " is " + person.age + " years old."); </script>
运行结果:
点击运行 »