Javascript equivalent of Python's dict.setdefault?
In Python, for a dictionary d,
d.setdefault('key', value)
sets d['key'] = value if 'key' was not in d, and otherwise leaves it as it is.
Is there a clean, idiomatic way to do this on a Javascript object, or does it require an if statement?