Guest User

Untitled

a guest
May 27th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // Pluck an object that contains a key and optional value
  2. function getBy(enumerable, findProperty, findValue){
  3. return jQuery.map(enumerable, function(el){
  4. if (typeof el[findProperty] !== 'undefined'){
  5. if (typeof findValue === 'undefined' ||
  6. el[findProperty] === findValue){
  7. return el;
  8. }
  9. }
  10. });
  11. }
Add Comment
Please, Sign In to add comment