Created
February 29, 2016 00:32
-
-
Save justinvh/700fe5d62126e5ab9fc9 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
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