Function that count the occurrence of number in an array
npm install occurrencefunkeThis package uses ES module that need to be import (import) the default package in order to use it.
Code to run to use it:
``sh`
npm install occurrencefunke
Add the code to your script file:
`js
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();
``