Question: Python's get method for dictionaries lets me specify what should be returned if a key doesn't exist. For my current case I want a dictionary returned. How do I do this in Javascript?

Answer: 
JavaScript has no helper feature to do that. You need to test explicitly.

```
if ("myProperty" in myObject) {
    return { another: "object" };
} else {
    return myObject.myProperty;
}

```

You can use a ternary operator to do the same thing with less code.

```
return ("myProperty" in myObject) ? myObject.myProperty : { another: "object" };

```
this works for me

```
let obj = {"a": 1};
let default = 100
obj["a"] || default; // -> 1
obj["b"] || default; // -> 100

```

But! there are some limitation, if `!!obj["a"] === false` we always get default value... so it's better to just check if key in obj, to be completely sure.