Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Pluck an object that contains a key and optional value
- function getBy(enumerable, findProperty, findValue){
- return jQuery.map(enumerable, function(el){
- if (typeof el[findProperty] !== 'undefined'){
- if (typeof findValue === 'undefined' ||
- el[findProperty] === findValue){
- return el;
- }
- }
- });
- }
Add Comment
Please, Sign In to add comment