<!DOCTYPE html>
<html>
<body>
<script>
var person={//声明可横跨多行
firstname : "Bill",
lastname : "Gates",
id : 5566
};
document.write(person.lastname + "<br />");//对象属性有两种寻址方式:
document.write(person["lastname"] + "<br />");
</script>
</body>
</html>
转载于:https://my.oschina.net/u/998691/blog/348752