Closed
Description
// Returns a string that's usable as an object id.
// Probably unique. Good enough? Probably!
function newObjectId() {
var chars = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
'abcdefghijklmnopqrstuvwxyz' +
'0123456789');
var objectId = '';
for (var i = 0; i < 10; ++i) {
objectId += chars[Math.floor(Math.random() * chars.length)];
}
return objectId;
}
How are we supposed to use that without certainity that it will always create unique objectId???
Metadata
Metadata
Assignees
Labels
No labels