明月笑刀无情
只需使用Object.values和flat-即使您不知道嵌套对象的键也可以使用:let Filus = { male: { hat: [1], jacket: [2], pants: [3], shoes: [4], suit: [5] }};const res = Object.values(Object.values(Filus)[0]).flat();console.log(res);ES5语法:var Filus = { male: { hat: [1], jacket: [2], pants: [3], shoes: [4], suit: [5] }};var res = Object.keys(Filus[Object.keys(Filus)[0]]).map(function(key) { return Filus[Object.keys(Filus)[0]][key];}).reduce(function(acc, curr) { return acc.concat(curr);});console.log(res);如果您拥有密钥,这也很容易:let Filus = { male: { hat: [1], jacket: [2], pants: [3], shoes: [4], suit: [5] }};const res = Object.values(Filus.male).flat();console.log(res);ES5语法:var Filus = { male: { hat: [1], jacket: [2], pants: [3], shoes: [4], suit: [5] }};var res = Object.keys(Filus.male).map(function(key) { return Filus.male[key];}).reduce(function(acc, curr) { return acc.concat(curr);});console.log(res);