1.0.3 • Published 8 years ago
count-values-inarray v1.0.3
count-values-inarray
A Node.js package that when provide integer array, finds count of all values.
Usage
First, install the package using npm:
npm install count-values-inarray --save
Then, require the package and use it like so:
var arrayCount = require('./arrayCount');
console.log(arrayCount(null)); // "invalid arguments"
console.log(arrayCount(undefined)); // "invalid arguments"
console.log(arrayCount("")); // "invalid arguments"
console.log(arrayCount([])); // 0
console.log(arrayCount([1,2,3])); // 6
console.log(arrayCount([1,2,"3"])); // 3
console.log(arrayCount([1,2,"3",4])); // 7
License
MIT