Skip to content

rafaelmenta/array-index-of-property

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

array-index-of-property Build Status

A helpful function to find object index by one of its properties


Installation

  • Node.js : npm install array-index-of-property --save-dev
  • Bower : bower install array-index-of-property --save

Usage

This package adds a indexOfProperty function to retrieve an object index given a value for any of its properties.

 var a = [{a : 0}, {a : 1}];
 console.log(a.indexOfProperty('a', 1); // Returns 1
 console.log(a.indexOfProperty('a', 2); // Returns -1

About

A helpful function to find object index by one of its properties

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published