@batya__002/average-rating is a simple JavaScript library that extends the array prototype to calculate the average rating of numerical values.
You can install the package using either npm or yarn:
# Using npm
npm i @batya__002/average-rating
# Using yarn
yarn add @batya__002/average-ratingYou can use the
import "@batya__002/average-rating'const arr = [20,30,50,"100", true, {id:1}]
console.log(arr.averageRating()); // 50.25
console.log(arr.averageRating(true)); // 50