[英]how do i replace in javascript user[0].firstName with user.firstName
Hello I want to access the information from my object like this您好,我想像这样访问我的对象中的信息
user.firstName
but I'm currently doing it like this但我目前正在这样做
user[0].firstName
I'm using angular js我正在使用角 js
this is the object structure这是对象结构
0: ObjectAccessKey: "example.com"BirthDate: "1969-12-31"CellPhone: "(888) 888-8888"City: "Holtwood"ClosedRegisterAt: nullCompanyId: "1"CreatedAt: "2015-05-31 20:31:00"EditedAt: "2015-05-31 21:32:22"EmergencyContactName: "hhhehee"EmergencyContactPhone: "(717) 444 4344"Employee: "Ben Eshleden"EmployeeId: "8"FirstName: "Ben"LastName: "Eshleden"MailingAddress: "1131 holtwood rd"OpenedRegisterAt: nullPassword: "candoa21"State: "AK"ZipCode: "17532"
use用
$.each(user, function (i, eachuser) {
name = eachuser.firstname;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.