I have the following function that I use to generate string-based unique IDs in a JavaScript program
var NewUid= (function () {
var _lastID = 0;
return function() {
return (_lastID++).toString(36); // *
}
})();
It has worked fine up to now. It should do since it's so basic. However, it's just failed on me in Chrome, by continually throwing a TypeError on the line marked * . The console log states:
Uncaught TypeError: Number.prototype.toString is not generic
The _lastID variable was at about 200000 when it occurred, so nothing too ridiculous. I've not been able to reproduce it so far. Can anyone tell why this may have happened?
I'm using Chrome '29.0.1547.76 m' if that helps.