mirror of https://github.com/zulip/zulip.git
3f95e54dc1
This is like Python's dict.setdefault. I don't love the name, but the consistency is nice. We have lots of places where we do things like: if (! dict.has('foo')) { dict.set('foo', []); } var arr = dict.get('foo'); arr.push(3); We can now write: var arr = dict.setdefault('foo', []); arr.push(3); (imported from commit b8933809c69ba47ec346ed51d53966793403e56c) |
||
---|---|---|
.. | ||
frontend |