对象:
var person={
firstname : "Bill",
lastname : "Gates",
id : 5566
};
寻址方式:
name=person.lastname;
name=person["lastname"];
例如:
<!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>
结果:
Gates
Gates