Last active
November 13, 2018 07:14
-
-
Save youngjinmo/c195763c1e62f91cfb8b4f9be1722dc4 to your computer and use it in GitHub Desktop.
Quiz 5-2 in Intro to JavaScript in Udacity
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
/* | |
* 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. | |
* | |
*/ | |
var num=0; | |
function laugh(num){ | |
var str=""; | |
for(var i=0; i<num; i++){ | |
str += "ha"; | |
} | |
return str+"!"; | |
} | |
console.log(laugh(3)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment