find_el_in_array
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Find Element In Array Build Status npm version

search in array

Getting Started

This is an npm package for search in array

Prerequisites

you should have node.js in your local machine

Installing

    npm i find_el_in_array
    
    //OR

    yarn add find_el_in_array

How To Use it

After install package

  1. Examples for simple array:
const FindElementInArray = require('find_el_in_array');

//OR

import FindElementInArray from 'find_el_in_array';


const findElementInArray = new FindElementInArray();

//simple array
    const testArray = [
      'milad', 'ezzat', 'fahmy', 1, 5, 8,
    ];
    const searchItem = 8;

const result = findElementInArray.searchInSimpleArray(testArray, searchItem);
// return 8

// complex array

  const testArray = [
    { id: 1, name: 'milad', age: 24 },
    { id: 2, name: 'ezzat', age: 24 },
    { id: 4, name: 'Milad', age: 24 },
    { id: 3, name: 'Fahym', age: 24 },
  ];
const result = searchInArray.searchInComplexArray(testArray, 'id', 4);
// return { id: 4, name: 'Milad', age: 24 }

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Package Sidebar

Install

npm i find_el_in_array

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

5.89 kB

Total Files

4

Last publish

Collaborators

  • miladezzat