Guest User

Untitled

a guest
Feb 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function wisePerson(wiseType, whatToSay) {
  2. return `A wise ${wiseType} once said: "${whatToSay}".`;
  3. }
  4.  
  5.  
  6. // tests
  7.  
  8. function testWisePerson() {
  9. const wiseType = 'goat';
  10. const whatToSay = 'hello world';
  11. const expected = 'A wise ' + wiseType + ' once said: "' + whatToSay + '".';
  12. const actual = wisePerson(wiseType, whatToSay);
  13. if (expected === actual) {
  14. console.log('SUCCESS: `wisePerson` is working');
  15. } else {
  16. console.log('FAILURE: `wisePerson` is not working');
  17. }
  18. }
  19.  
  20. testWisePerson();
Add Comment
Please, Sign In to add comment