首页 > 代码库 > JS 对象

JS 对象

JS 对象:

var person = {    firstname : "Bill",    lastname : "Gates",    age : 56};
var person = new Object();person.firstname = "Bill";person.lastname = "Gates";person.age = 56;

 

寻址方式:

var firstname = person.firstname;var firstname = person["firstname"];