Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Map.prototype.inc = function(s) {
- if (this.has(s)) this[s] = this[s]+1
- else this[s] = 1
- }
- var test = new Map()
- test.inc("a"); test.inc("a"); test.inc("b");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement