将一个数字扁平化,去重并升序

const _arr = [[21,213],[1,43,125,89],[[23,54],90,389],12];

[...new Set(_arr.flat(Infinity))].sort((a,b)=>{
    return a-b
})
(11) [1, 12, 21, 23, 43, 54, 89, 90, 125, 213, 389]
原文地址:https://www.cnblogs.com/chenzeyongjsj/p/11234998.html