Created
December 18, 2017 08:52
-
-
Save desinas/419da4b3392819edb08e41e62e0ad193 to your computer and use it in GitHub Desktop.
Laugh it off Quizz (5-2) of Udacity FEWD
This file contains hidden or 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
| /* | |
| * Programming Quiz: Laugh it Off 2 (5-2) | |
| * | |
| * Write a function called `laugh` with a parameter named `num` that represents the number of "ha"s to return. | |
| * | |
| * Note: | |
| * - make sure your the final character is an exclamation mark ("!") | |
| */ | |
| function laugh(num) { | |
| message = ""; | |
| while (num > 0) { | |
| message+= "ha"; | |
| num--; | |
| } | |
| return message + "!"; | |
| } | |
| console.log(laugh(5)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What Went Well
Feedback: Your answer passed all our tests! Awesome job!