JavaScript
JavaScript 对象
- 创建 JavaScript 对象 I
源代码:
点击运行 »
<p>创建 JavaScript 对象。</p> <p id="demo"></p> <script> var person = { firstName: "John", lastName: "Doe", age: 50, eyeColor: "blue" }; document.getElementById("demo").innerHTML = person.firstName + " 现在 " + person.age + " 岁."; </script>
运行结果:
点击运行 »