Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. Map.prototype.inc = function(s) {
  2. if (this.has(s)) this[s] = this[s]+1
  3. else this[s] = 1
  4. }
  5.  
  6. var test = new Map()
  7. test.inc("a"); test.inc("a"); test.inc("b");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement