Skip to content

Instantly share code, notes, and snippets.

@desinas
Created December 18, 2017 08:52
Show Gist options
  • Save desinas/419da4b3392819edb08e41e62e0ad193 to your computer and use it in GitHub Desktop.
Save desinas/419da4b3392819edb08e41e62e0ad193 to your computer and use it in GitHub Desktop.
Laugh it off Quizz (5-2) of Udacity FEWD
/*
* 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));
@desinas
Copy link
Author

desinas commented Dec 18, 2017

What Went Well

  • Your code should have a laugh function
  • Your laugh() function should have one parameter
  • Your laugh() function should have a parameter named num
  • Your laugh() function should return the correct number of laughs

Feedback: Your answer passed all our tests! Awesome job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment