Array Types
Get a beautiful string representation of types inside of an Array.
Inspiration
To be completely fair, none. I needed a tiny, zero dependency package for a project that would do this, so I decided to create one.
Installation
Simply run
npm install --save get-array-types
Usage
const ArrayTypes = console//=> Array<number|string> console//=> ['number', 'string'] console//=> true console//=> false
get-array-types
also provides a useful utility function, isArray
.
Use it as follows:
const isArray = isArray console//=> false console//=> true
License
- MIT
Happy Javascripting! 〰️