gxi-search-array
v1.0.2
Published
This package help you to search any key value from array of objects and return you a new set of array with the exact keyword
Downloads
3
Readme
Introduction
Get exact searched value from any type of array.
Installation
npm install gxi-search-array --save
Usage
import SearchedArray from 'gxi-search-array'
const students = [
{
name: 'John Smith',
age: 15,
sports: [
{
id: 1,
name: 'Football'
},
{
id: 4,
name: 'Cricket'
}
]
},
{
name: 'Miller',
age: 16,
sports: [
{
id: 1,
name: 'Football'
}
]
}
];
const searched = SearchedArray(students, 'Cricket');
console.log(searched)
/*
[
{
name: 'John Smith',
age: 15,
sports: [
{
id: 1,
name: 'Football'
},
{
id: 4,
name: 'Cricket'
}
]
}
]
*/