Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function whatIsInAName(collection, source) {
  2. // What's in a name?
  3. var arr = [];
  4.  
  5. function checkSource(item) {
  6. return source.every(function(source) {
  7.  
  8. });
  9.  
  10. }
  11. // Only change code below this line
  12. arr = collection.filter(checkSource);
  13.  
  14. // Only change code above this line
  15. return arr;
  16. }
  17.  
  18. whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement