Skip to content

Commit

Permalink
tweak uniqueId
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Dec 3, 2012
1 parent 9975ebb commit 35796f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions underscore.js
Expand Up @@ -1070,8 +1070,8 @@
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = idCounter++;
return '' + (prefix ? '' + prefix + id : id);
var id = '' + ++idCounter;
return prefix ? prefix + id : id;
};

// By default, Underscore uses ERB-style template delimiters, change the
Expand Down

0 comments on commit 35796f1

Please sign in to comment.