0
讓說的屬性:環路一個js類
function person(){
this.name = null;
this.lastname = null;
this.age = null;
this.height = null;
}
我怎樣才能通過屬性迭代?
喜歡的東西:
foreach(properties as property){
console.log (property.nameoftheproperty, property.valueoftheproperty);
}
嘗試'for(var x in person){x,person [x]}'或'Object.keys(person)' – exebook