import { count } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/array.js";
Counts the occurrence of the element in the array.
Examples
Example 1
Example 1
import { count } from "@ayonli/jsext/array";
const arr = [1, 2, 3, 4, 5, 2, 3, 4, 2];
console.log(count(arr, 2)); // 3
console.log(count(arr, 6)); // 0