1、
//==========对象(只能出现一对)
var users2 = { "name": "manas", "gen": "male","objs":{"sex":"小王","lives":"武汉"} };
var users = { "name": "manas", "gen": "male" };
console.log(users.name);
console.log(users2.objs.sex);
//==========数组
var userlist = [{ "user": { "name": "Manas", "gender": "Male", "birthday": "1987-8-8" } }, { "user": { "name": "Manas22", "gender": "Male22", "birthday": "1987-8-8" } }];
var userlist2 = [{ "user": { "name": "Manas", "gender": "Male", "birthday": "1987-8-8" } }, { "arrs": { "name": "Manas22", "gender": "Male22", "birthday": "1987-8-8" } }];
var userlist3 = [{ "name": "Manas", "gender": "Male", "birthday": "1987-8-8" } , { "name": "Manas", "gender": "Male", "birthday": "1987-8-8" } ];
for (var i = 0; i < userlist.length; i++) {
console.log(typeof (userlist[i]));
console.log(userlist[i].user.name);
}
console.log("============");
console.log(userlist2[0].user.name);
console.log(userlist2[1].arrs.name);
console.log("============");
console.log(userlist3[1].name);
for (var i = 0; i < userlist3.length; i++) {
userlist2[i].name;
}