- Let's first look at how to use:
// If you created a regular JavaScript file (without Node.js)
import ArrayUtil from "alisa.array";
// But if you have created Node.js file, you should use it like this
const ArrayUtil = require("alisa.array");
const array = [1, 2, 3, 4, 5];
const filterAndMap = ArrayUtil.filterAndMap(
array,
(number) => number >= 3,
(number) => number * number
)
console.log(filterAndMap); // [9, 16, 25]
- If your code compiler says something like "No such function" after typing "filterAndMap" or something else, ignore it, if you have imported the module correctly it will work.
- The module has many more features like this. Below are the features added thanks to this module, what they all do and an example for each.
- sameArray
- allIndexOf
- findIndexAll
- concatAll
- filterAndMap
- pushWithSort
- swap
- count
- shuffle
- difference
- removeDuplicate
- chunk
- groupBy
- toObject
- toSet
- similar
- permutations
- onlyEvens
- onlyOdds
- reversed
- max
- min
- uniqueBy
- flatten
📌 Each function is fully documented in the codebase and comes with examples and type validations.
Please do not forget to use the latest version for the most stable and performant experience!
- First of all, thank you so much for reading this far <3
- Since my English is not very good, I may have made a language mistake in some places, sorry for that. I'm learning and improving more every day 💪
- If there are mistakes in the module or suggestions for improvement, feel free to reach out.
- If you want to support this module, please ⭐ the repo on GitHub!
- Thank you again — I love you 💗
- See you in my next modules!