mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
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)
|
||
|---|---|---|
| .. | ||
| audio | ||
| html | ||
| images | ||
| js | ||
| styles | ||
| templates | ||
| third | ||
| .gitignore | ||
| favicon.ico | ||
| robots.txt | ||