count-values-inarray

1.0.3 • Public • Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i count-values-inarray

      Weekly Downloads

      0

      Version

      1.0.3

      License

      MIT

      Last publish

      Collaborators

      • gkmrakesh