js sort map by key
Map
map to array
// Array.from()
Object
let obj = {};
for(let key of Object.keys(obj).sort()) {
log(`key`, key, obj[key])
strs.push(obj[key]);
}
refs
https://stackoverflow.com/questions/5467129/sort-javascript-object-by-key
https://stackoverflow.com/questions/37982476/how-to-sort-a-map-by-value-in-javascript
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!