Skip to content

Instantly share code, notes, and snippets.

@willwalker753
Created February 12, 2020 19:46
Show Gist options
  • Save willwalker753/dac1b8cd35b508194ecb280c4d5063db to your computer and use it in GitHub Desktop.
Save willwalker753/dac1b8cd35b508194ecb280c4d5063db to your computer and use it in GitHub Desktop.
Wiseperson generator
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