11 ms·
I haven't yet needed to use a constructor in a HOF. And in the event I do, I can just wrap it in a lambda. But I see your point, it feels cleaner to just not ha
by sbjs 8y ago
I haven't yet needed to use a constructor in a HOF. And in the event I do, I can just wrap it in a lambda. But I see your point, it feels cleaner to just not have the new keyword. But without it, you have no guarantee that the function is going to return a new object, it could return anything it wants. At least this way we have a little more safety from monkey patching or programmer error.
- jolmg 8y ago> But without it, you have no guarantee that the function is going to return a new object, it could return anything it wants. It can still return anything it wants when you use `new`.