Closed ljharb closed 6 years ago
@bterlson Do you know whether the "is present" checks are necessary here?
I think technically yes given that the thisArg parameter is optional. However, I think the contract for this API is that if mapperFunction is passed, thisArg is always present. You could probably get away with making this an assert rather than applying the default.
Either way; happy to change it to an assert instead.
Cool. Let's make it an assertion.
Updated.
Personally I'd prefer all the "is present" language be removed, but I'm not sure if it's necessary on the default args. If it is, then this change is needed; if it's not, then all the checks should be against
undefined
, not testing presence.