1.0.1 • Published 6 years ago

foia v1.0.1

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

foia

Find Object In an Array of objects

installation

npm install foia

usage

return the first index of the found object. Otherwise return -1.

var arrayofobjects = [
  { a : 'a' , b : 'b' },
  { c : 'c' , d : 'd' }
];

var foundobjindex = foia(arrayofobjects,{ a: 'a' , b : 'b'});
var notfoundobjindex = foia(arrayofobjects,{ a: 'b' , b : 'a'});

//foundobjindex : 0
//notfoundobjindex : -1
1.0.1

6 years ago

1.0.0

6 years ago