js sort map by key
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 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13961620.html
未经授权禁止转载,违者必究!