occurrencefunke
v1.1.0
Published
Function that count the occurrence of number in an array
Readme
Occurrence Package
This package uses ES module that need to be import (import) the default package in order to use it.
Code to run to use it:
npm install occurrencefunkeAdd the code to your script file:
import Occur from "occurrencefunke";
function check() {
console.log(Occur([1, 2, 3, 2, 1, 4, 4, 5, 4, 2]));
//output "{ '1': 2, '2': 3, '3': 1, '4': 3, '5': 1 }"
console.log(Occur([1, 2, 3, 4, 1, 1, 4, 5, 4, 2]));
//output "{ '1': 3, '2': 2, '3': 1, '4': 3, '5': 1 }"
}
check();