对象排序
function sortObject(obj, sort) {
const result = {};
Object.keys(obj)
.sort(sort)
.forEach(key => {
result[key] = obj[key];
});
return result;
}
对象排序
function sortObject(obj, sort) {
const result = {};
Object.keys(obj)
.sort(sort)
.forEach(key => {
result[key] = obj[key];
});
return result;
}