OrderBy

With the "orderBy" function you can reorder the data in your json array.

Github repository for your stars.

Usage

Install

$ npm install json-function

Import

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

Sort Deep

Example Data

Last updated

Was this helpful?