Where
The "Where" function provides a comfortable method for filtering a json data.
Github repository for your stars.
Usage
Install
$ npm install json-functionImport
import { where } from 'json-function';Usage
Example Data
const data = [
{
id: 1,
userId: 1,
title: "delectus aut autem",
completed: false,
education: {
isDone: true
}
},
{
id: 2,
userId: 1,
title: "lorem ipsum",
completed: true,
education: {
isDone: true
}
},
{
id: 3,
userId: 2,
title: "quis ut nam facilis et officia qui",
completed: false,
education: {
isDone: false
}
}
];Basic Syntax
Output
AND Syntax
Output
OR Syntax
Output
Use "callback" for advanced filter.
Other wh methods.
Deep Where Syntax
Output
Last updated
Was this helpful?
