Guest User

Untitled

a guest
Apr 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. function wisePerson(wiseType, whatToSay) {
  2. // your code here
  3. return `A wise ${wiseType} once said: "${whatToSay}".`;
  4. /*return `A wise ${wiseType} once said: "${whatToSay}".`; (with and without ()*/
  5. /*console.log('A wise ' + wiseType + ' once said: ' + '"' + whatToSay +'"' + '.'); WORKS IN DEV TOOLS CONSOLE BUT NOT IN REPL CONSOLE**/
  6. }
  7.  
  8. console.log(wisePerson('goat', 'Hello World'));
  9. /* From here down, you are not expected to
  10. understand.... for now :)
  11.  
  12.  
  13. Nothing to see here!
  14.  
  15. */
  16.  
  17. // tests
  18.  
  19. function testWisePerson() {
  20. const wiseType = 'goat';
  21. const whatToSay = 'hello world';
  22. const expected = 'A wise ' + wiseType + ' once said: "' + whatToSay + '".';
  23. const actual = wisePerson(wiseType, whatToSay);
  24. if (expected === actual) {
  25. console.log('SUCCESS: `wisePerson` is working');
  26. } else {
  27. console.log('FAILURE: `wisePerson` is not working');
  28. }
  29. }
  30.  
  31. testWisePerson();
Add Comment
Please, Sign In to add comment