Created
February 12, 2020 19:52
-
-
Save willwalker753/25538ca5f7a02c1d8216958cd1e32e91 to your computer and use it in GitHub Desktop.
Shouter
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 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