Returns true if a value is an array containing the specified number of elements.
npm install is-array-of-lengthReturns true if a value is an array containing the specified number of elements.
Requires Node.js 6.0.0 or above.
``bash`
npm i is-array-of-length
The module exports a single function.
1. arr (any): What may or may not be an arraylengths
2. (integer or array): One or more integers, each of which represents an acceptable number of items in the array.arrays
3. Optional: Object argument:
* (class, string, or array): One or more classes or names of classes that should be treated as equivalent to Array.
* true if arr is an array with a length given in lengthsfalse
* otherwise
`javascript
const isArrayOfLength = require('is-array-of-length')
isArrayOfLength(['a', 'b'], 2) // true
isArrayOfLength(['a', 'b'], 3) // false
isArrayOfLength(['a', 'b'], [2, 3]) // true
isArrayOfLength('7 chars', 7) // false
// Supports the bind operator
['a', 'b']::isArrayOfLength(2) // true
``