Created
November 27, 2013 01:02
-
-
Save kamilogorek/7669062 to your computer and use it in GitHub Desktop.
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
(function makeThanksgivingHappen (wishes) { | |
function Thanks () { | |
this.given = false; | |
} | |
Thanks.prototype.give = function () { | |
this.given = true; | |
} | |
var thanks = new Thanks(); | |
do { | |
try { | |
thanks.give(); | |
} catch (e) { | |
throw new Error(e.message); | |
} | |
} while (!thanks.given); | |
return wishes; | |
})('You just gave an awesome thanks!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment