for...in...
有两个用途:
示例:
const names = ["Kent Beck", "Erich Gamma", "James Gosling", "Doug Lea", "Bob Lee"];
for (let i in names) {
console.log(names[i]);
}
示例:
const person = {
name : "Kent Beck",
age : 56,
gender : "male",
address : "美国俄勒冈州科瓦利斯市"
};
for (let attribute in person) {
console.log(person[attribute]);
}