📅  最后修改于: 2022-03-11 14:48:27.555000             🧑  作者: Mango
const [small, large] = // Use "deconstruction" style assignment
[12, 5, 8, 130, 44]
.reduce((result, element) => {
result[element <= 10 ? 0 : 1].push(element); // Determine and push to small/large arr
return result;
},
[[], []]); // Default small/large arrays are empty