If I have an object, with properties like name, phone_number, etc...how can I access those in Javascript with a variable?
I want to access the property name in javascript by doing something like this:
object {name : "bob", phone_number : "911" }
propertiesArray = ["name","phone_number"];
object.propertiesArray[0]; // instead of object.name;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…