Skip to content

Instantly share code, notes, and snippets.

@AppMkrATL
Last active February 13, 2018 13:47
Show Gist options
  • Save AppMkrATL/7300c5302c9824284fd612cea573de4f to your computer and use it in GitHub Desktop.
Save AppMkrATL/7300c5302c9824284fd612cea573de4f to your computer and use it in GitHub Desktop.
1_Wiseperson generator
function wisePerson(wiseType, whatToSay) {
// your code here
const actual = ('A wise ' + wiseType + ' once said: "' + whatToSay + '".');
return (actual)
}
wisePerson('goat', 'Hello world')
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
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