Skip to content

Instantly share code, notes, and snippets.

@nikhilmufc7
Created December 14, 2016 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilmufc7/f20d765b51a9e54c0570363a499ca8b9 to your computer and use it in GitHub Desktop.
Save nikhilmufc7/f20d765b51a9e54c0570363a499ca8b9 to your computer and use it in GitHub Desktop.
function shouter(whatToShout) {
// your code here
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testShouter() {
var whatToShout = 'fee figh foe fum';
var expected = 'FEE FIGH FOE FUM!!!';
if (shouter(whatToShout) === expected) {
console.log('SUCCESS: `shouter` is working');
}
else {
console.log('FAILURE: `shouter` is not working');
}
}
testShouter();
function textNormalizer(text) {
// your code here
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testTextNormalizer() {
var text = " let's GO SURFING NOW everyone is learning how ";
var expected = "let's go surfing now everyone is learning how";
if (textNormalizer(text) === expected) {
console.log('SUCCESS: `textNormalizer` is working');
}
else {
console.log('FAILURE: `textNormalizer` is not working');
}
}
testTextNormalizer();
function wisePerson(wiseType, whatToSay) {
// your code here
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// 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