Skip to content

Add isCallable() and isConstructable() #52

@jcbhmr

Description

@jcbhmr

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
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions