JSPM

array-occurrence

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q19134F
  • License MIT

Get the number of occurrences of an item in an array

Package Exports

  • array-occurrence

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (array-occurrence) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

input

Type: array

Array to search in.

Type: Any type

Item to search for.

License

MIT © Andreas Gillström