Releases: JordanRad/dasugo
Version 0.1.0
Version 0.1.0 Changelog:
This initial version of the package includes several helper methods that can be used to manipulate arrays of various types.
-
Map: This method applies a given function to each element of an array and returns a new array with the modified values. It takes an array of type T and a function that takes an element of type T and returns a new element of type T.
-
Filter: This method filters an array based on a given predicate and returns a new array with the elements that satisfy the predicate. It takes an array of type T and a function that takes an element of type T and returns a boolean value.
-
Reduce: This method reduces an array to a single value by applying a given function to each element and accumulating the result. It takes an array of type T, a function that takes two parameters, an accumulator of type ReduceResult and an element of type T, and an initial value of type ReduceResult.
-
Some: This method checks if any element in an array satisfies a given predicate and returns a boolean value. It takes an array of type T and a function that takes an element of type T and returns a boolean value.
-
Contains: This method checks if an array contains a given element and returns a boolean value. It takes an array of type T and an element of type T.
-
Intersect: This method finds the common elements between two arrays and returns a new array with those elements. It takes two arrays of type T.
These methods can be used to perform common operations on arrays in a concise and readable way.