Skip to content

Instantly share code, notes, and snippets.

@ceci21
Last active August 3, 2017 00:55
Show Gist options
  • Save ceci21/f418c35284c67c427c23b68ba9c5154e to your computer and use it in GitHub Desktop.
Save ceci21/f418c35284c67c427c23b68ba9c5154e to your computer and use it in GitHub Desktop.
returns a function that console.logs OHOHO, but it multiplies HOHO every time you call it, but it kinda starts to get out of hand if you do it too much
function sayOho() {
var string = 'O';
var i = 1;
return function() {
for (var k = 0; k < i; k++) {
string = string + "HO";
}
i = Math.pow(2, i);
console.log(string);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment