Created
January 16, 2018 20:22
-
-
Save vontell/cd7a2aeeb4459397eba9437098e3e928 to your computer and use it in GitHub Desktop.
001 Remove Record
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
/** | |
* Deletes the shortened URL record associated with the given shortenedURL, | |
* returning the short URL word used back to the word pool. | |
* shortenedURL - A shortened URL generated by this program instance | |
*/ | |
function removeShortenedURL(shortenedURL) { | |
var word = shortenedURL.replace(baseDomain, ""); | |
delete urlDictionary[word]; | |
words.push(word); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment