Open jcbhmr opened 1 year ago
https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md
☝ Basically that.
Use case:
if (isConstructable(thing)) { return new thing() } else if (isCallable(thing)) { return thing() } else { return thing }
Seems good to me! PR welcome
https://github.com/caitp/TC39-Proposals/blob/trunk/tc39-reflect-isconstructor-iscallable.md
☝ Basically that.
Use case: