Created
March 31, 2016 21:44
-
-
Save garvin/0266789815689e2b81c931f8113b0eec to your computer and use it in GitHub Desktop.
Quick & dirty unique ID generator
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
/** | |
* Creates a string that can be used for dynamic id attributes | |
* Example: "id-so7567s1pcpojemi" | |
* @returns {string} | |
*/ | |
var uniqueId = function() { | |
return 'id-' + Math.random().toString(36).substr(2, 16); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment