In javascript, we often see code like the following to set a default parameter when we don't care to ignore falsey values.
function SomeObject (param) {
this.param = param || {};
}
Occasionally though, when reading code, I'll come across the following variation:
function SomeObject (param) {
this.param = param = param || {};
}
Can someone explain to me the use case for this?