sortByKeyLength
sortByKeyLength(obj)
sortByKeyLength(obj)Arguments
Returns
Example
typescript
import { sortByKeyLength } from 'check-engineering/ts-utils';
const data = {
name: 'Alice',
age: 30,
city: 'New York',
country: 'USA'
};
const sortedData = sortByKeyLength(data);
// ==> [
// { key: 'country', value: 'USA' },
// { key: 'city', value: 'New York' },
// { key: 'name', value: 'Alice' },
// { key: 'age', value: 30 }
// ]Usage
Notes
Last updated