Skip to content

Instantly share code, notes, and snippets.

@desinas
Created December 19, 2017 14:55
Show Gist options
  • Save desinas/70a29091705526859eb98d3522393847 to your computer and use it in GitHub Desktop.
Save desinas/70a29091705526859eb98d3522393847 to your computer and use it in GitHub Desktop.
Laugh Quiz (5-4) of Udacity FEWD
/*
* Programming Quiz: Laugh (5-4)
*/
var laugh = function(times) {
var haTimes= "";
while (times > 0) {
haTimes +="ha";
times --;
}
haTimes= haTimes +"!";
return haTimes;
}
console.log(laugh(10));
@desinas
Copy link
Author

desinas commented Dec 19, 2017

What Went Well

  • Your code should have a variable laugh
  • Your code should include an anonymous function expression stored in the variable laugh
  • Your function expression should take one argument
  • Your function expression should return the correct number of hahaha's

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