Skip to content

Instantly share code, notes, and snippets.

@CodeSigils
Last active October 25, 2016 18:26
Show Gist options
  • Save CodeSigils/0dcd0aec7a48a2716e5f8ace3d4d1274 to your computer and use it in GitHub Desktop.
Save CodeSigils/0dcd0aec7a48a2716e5f8ace3d4d1274 to your computer and use it in GitHub Desktop.
Wise person generator
function wisePerson(wiseType, whatToSay) {
return 'A wise ' + wiseType + ' once said: "' + whatToSay + '".';
}
wisePerson('goat', 'hello world');
// tests
function testWisePerson() {
var wiseType = 'goat';
var whatToSay = 'hello world';
var expected = 'A wise ' + wiseType + ' once said: "' +
whatToSay + '".';
var 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