1.0.0 • Published 9 years ago

array-occurrence v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

array-occurrence Build Status

Get the number of occurrences of an item in an array

Install

$ npm install --save array-occurrence

Usage

var arrayOccurrence = require('array-occurrence');

arrayOccurrence(['foo', 'bar', 'foo'], 'foo');
//=> 2

API

arrayOccurrence(input, search)

input

Type: array

Array to search in.

search

Type: Any type

Item to search for.

License

MIT © Andreas Gillström