get-constructor-name
v0.0.1
Published
Get the Name of a JavaScript Function's Constructor. Returns String or Undefined.
Downloads
508
Maintainers
Readme
get-constructor-name
Get the Name of a JavaScript Function's Constructor. Returns String or Undefined.
features
- guaranteed to return string or undefined
- doesn't throw errors
install
npm install get-constructor-name
usage
import getConstructorName from "get-constructor-name";
const arrayBuffer = new ArrayBuffer();
getConstructorName(arrayBuffer) // ArrayBuffer
getConstructorName(100) // undefined
getConstructorName(null) // undefined