1.0.0 • Published 6 years ago

key-for-id v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Table of Contents

Install

Add key-for-id to your project using npm or yarn.

Install (NPM):

$ npm install key-for-id --save

Install (Yarn):

$ yarn add key-for-id

Usage

Import KeyForID into Your Project

import KeyForID from 'key-for-id'

Pass An Array as the first parameter, the key as the second and the value your searching for as the third.

let people = [{name: 'Josh'}, {name: 'Steven'}, {name: 'Sarah'}]
let index = KeyForID(people, 'name', 'Sarah') // 2

Contributing

Pull requests for new features, bug fixes, and suggestions are welcome!

License

MIT