Skip to content

Instantly share code, notes, and snippets.

@willwalker753
Created February 12, 2020 19:52
Show Gist options
  • Save willwalker753/25538ca5f7a02c1d8216958cd1e32e91 to your computer and use it in GitHub Desktop.
Save willwalker753/25538ca5f7a02c1d8216958cd1e32e91 to your computer and use it in GitHub Desktop.
Shouter
function shouter(whatToShout) {
let shout = whatToShout.toUpperCase();
shout = shout + '!!!';
return shout;
}
let whatToShout = ('as you can hear i am whispering');
console.log(shouter(whatToShout));
function testShouter() {
const whatToShout = 'as you can hear i am whispering';
const expected = 'AS YOU CAN HEAR I AM WHISPERING!!!';
if (shouter(whatToShout) === expected) {
console.log('SUCCESS: `shouter` is working');
} else {
console.log('FAILURE: `shouter` is not working');
}
}
testShouter();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment