1.0.1 • Published 8 months ago
array-methods-by-trisha v1.0.1
Array Utilities Package
This is a lightweight JavaScript utility package that provides helpful functions for array manipulation. With this package, you can easily perform common array operations like calculating the sum of all elements or removing duplicates from an array, without needing to write custom code every time.
Features
The following methods are used to manipulate Array
and get the result of it:
sum()
: Returns the sum of all elements in the array.removeDuplicates()
: Removes duplicate values from the array and returns a new array with unique values.average()
: Returns the average of all elements in the array.max()
: Returns the maximum value in the array.min()
: Returns the minimum value in the array.sortDesc()
: Sorts the array in descending order and returns a new sorted array.median()
: Returns the median value of the array.filterEven()
: Filters and returns an array containing only even numbers.filterOdd()
: Filters and returns an array containing only odd numbers.clear()
: Clears all elements in the array and returns the array as an empty one.
Installation
You can install this package via npm:
npm install array-methods-by-trisha
1.0.1
8 months ago