Last active
October 25, 2016 18:26
-
-
Save CodeSigils/0dcd0aec7a48a2716e5f8ace3d4d1274 to your computer and use it in GitHub Desktop.
Wise person 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) { | |
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