Skip to content

Instantly share code, notes, and snippets.

@justinvh
Created February 29, 2016 00:32
Show Gist options
  • Save justinvh/700fe5d62126e5ab9fc9 to your computer and use it in GitHub Desktop.
Save justinvh/700fe5d62126e5ab9fc9 to your computer and use it in GitHub Desktop.
var getWord = function (database, callback) {
random_word_request(function (data) {
var word = data.word;
// If the word exists, find again
if (database.find(word)) {
return getWord(database, callback);
}
database.push(word);
callback(word);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment