This is a JavaScript library containing various array manipulation functions. These functions are useful for finding unique elements, filtering odd/even numbers and manipulating arrays efficiently.
You can install this library via npm:
npm install array-helper-kit
// Import the library
const arrayUtils = require('array-helper-kit');
// Example usage of functions
const numbers = [1, 2, 3, 4, 5];
console.log("Sum of array:", arrayUtils.sum(numbers)); // Output: Sum of array: 15
Calculates the sum of all elements in the input array.
Filters out all even numbers from the input array.
Filters out all odd numbers from the input array.
Reverses the elements of the input array.
Returns a new array with only unique elements from the input array.
Finds the maximum value in the input array.
Finds the minimum value in the input array.
Removes duplicate numbers from the input array.
Swaps two elements in an array.
Finds the kth smallest element in an array.
This project is licensed under the MIT License - see the LICENSE file for details.