Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. function makeList(item1, item2, item3) {
  2. console.log(makeList.map)
  3. return [item1, item2, item3]
  4.  
  5.  
  6.  
  7.  
  8. }
  9.  
  10. /* From here down, you are not expected to
  11. understand.... for now :)
  12.  
  13.  
  14. Nothing to see here!
  15.  
  16. */
  17.  
  18. // tests
  19.  
  20. function testMakeList() {
  21. const items = ['prime rib', 'fried goat cheese salad', 'fish tacos'];
  22. const result = makeList(items[0], items[1], items[2]);
  23.  
  24. if (
  25. result &&
  26. result.length &&
  27. items.length === result.length &&
  28. items.every(function(item) {
  29. return result.indexOf(item) > -1;
  30. })
  31. ) {
  32. console.log('SUCCESS: `makeList` works!');
  33. } else {
  34. console.error('FAILURE: `makeList` is not working');
  35. }
  36. }
  37.  
  38. testMakeList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement