Skip to content

ZetaE/foia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

find object in a array of objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published