Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function wisePerson(wiseType, whatToSay) {
  2. return `A wise ${wiseType} once said: "${whatToSay}".`;
  3.  
  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. // tests
  17.  
  18. function testWisePerson() {
  19. const wiseType = 'goat';
  20. const whatToSay = 'hello world';
  21. const expected = 'A wise ' + wiseType + ' once said: "' + whatToSay + '".';
  22. const actual = wisePerson(wiseType, whatToSay);
  23. if (expected === actual) {
  24. console.log('SUCCESS: `wisePerson` is working');
  25. } else {
  26. console.log('FAILURE: `wisePerson` is not working');
  27. }
  28. }
  29.  
  30. testWisePerson();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement