Guest User

Untitled

a guest
Oct 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. function makeList(item1, item2, item3) {
  2. // your code here
  3. return [item1, item2, item3];
  4. }
  5.  
  6.  
  7.  
  8. /* From here down, you are not expected to
  9. understand.... for now :)
  10.  
  11.  
  12. Nothing to see here!
  13.  
  14. */
  15.  
  16.  
  17. // tests
  18.  
  19. function testMakeList() {
  20.  
  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 && result.length && items.length === result.length &&
  26. items.every(function(item) {
  27. return result.indexOf(item) > -1;
  28. })) {
  29. console.log('SUCCESS: `makeList` works!');
  30. } else {
  31. console.error('FAILURE: `makeList` is not working');
  32. }
  33. }
  34.  
  35. testMakeList();
Add Comment
Please, Sign In to add comment