Created
February 12, 2020 19:46
-
-
Save willwalker753/dac1b8cd35b508194ecb280c4d5063db to your computer and use it in GitHub Desktop.
Wiseperson generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wisePerson(wiseType, whatToSay) { | |
let quote = 'A wise ' + wiseType + ' once said: "' + whatToSay + '."'; | |
return quote; | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
Nothing to see here! | |
*/ | |
let wiseType = 'goat'; | |
let whatToSay = 'Hello world'; | |
console.log(wisePerson(wiseType, whatToSay)); | |
function testWisePerson() { | |
const wiseType = 'goat'; | |
const whatToSay = 'hello world'; | |
const expected = 'A wise ' + wiseType + ' once said: "' + whatToSay + '."'; | |
const actual = wisePerson(wiseType, whatToSay); | |
if (expected === actual) { | |
console.log('SUCCESS: `wisePerson` is working'); | |
} else { | |
console.log('FAILURE: `wisePerson` is not working'); | |
} | |
} | |
testWisePerson(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment