array-operations-by-ganesh
v1.0.1
Published
A simple utility package that provides useful array operation methods without relying on JavaScript's built-in array methods. This package can help you perform common array tasks such as summing values, removing duplicates, flattening arrays, and more.
Downloads
43
Readme
Array Operations Package
A simple utility package that provides useful array operation methods without relying on JavaScript's built-in array methods. This package can help you perform common array tasks such as summing values, removing duplicates, flattening arrays, and more.
Features
- Sum: Calculate the sum of all the elements in an array.
- Remove Duplicates: Return a new array with all duplicates removed.
- Average: Calculate the average of the elements in the array.
- Max: Find the maximum value in the array.
- Min: Find the minimum value in the array.
- First N Elements: Retrieve the first
N
elements of the array. - Last N Elements: Retrieve the last
N
elements of the array. - Is Sorted: Check whether the array is sorted.
- Frequency Count: Return a count of how frequently each element appears in the array.
- Flatten: Flatten a nested array into a single-level array.
Installation
You can install the package using npm:
npm install array-operations-by-ganesh