Re:Isaacs: try/catch is an anti-pattern
by TylerE on Monday November 14, 2011 @09:55AM
(#3234164)
Because it's actually (somewhat confusingly, called setdefault).
This actually updates the underlying datastructure. Very handy when you want to deal with nested structures, since you can do something like:
This will append s to the list in matches[keyword] if it exists, or set matches[keyword] to [] and then append.
[ Parent
| on HN ]
There are no comments on this comment yet.