简单教程
提交运行
代码编辑器:
<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>
运行结果: