OrderBy
With the "orderBy" function you can reorder the data in your json array.
Github repository for your stars.
Usage
Install
$ npm install json-functionImport
import { orderBy } from 'json-function';Usage
Example Data
const data = [
{
id: 1,
userId: 1,
title: "quis ut nam facilis et officia qui"
},
{
id: 2,
userId: 1,
title: "lorem ipsum"
},
{
id: 3,
userId: 2,
title: "delectus aut autem"
}
];DESC Syntax
Output
ASC Syntax
Output
It is currently only sorting with string and number values. Soon the date ranking support will come.
Sort Deep
Example Data
Last updated
Was this helpful?
