array-utils-mini
v1.1.2
Published
A mini JavaScript array utility library with manually implemented core methods.
Maintainers
Readme
📦 array-utils-mini
A lightweight JavaScript utility library that re-implements core and intermediate array methods from scratch — perfect for learning, interviews, and low-level control.
No built-in array methods used (except length)!
🚀 Installation
npm install array-utils-mini📚 What’s Inside?
✅ Basic Methods
push(arr, value)pop(arr)shift(arr)unshift(arr, value)indexOf(arr, value)includes(arr, value)reverse(arr)
Medium-Level Operations
map(arr, callback)filter(arr, callback)reduce(arr, callback, initial)slice(arr, start, end)splice(arr, index, deleteCount, ...items)
✨ Bonus Features
unique(arr)— remove duplicate valuesmax(arr)— get the maximum valuemin(arr)— get the minimum valueinsertArrayAt(arr, pos, toInsert)— insert an array in a specific position of an array
🔧 Usage
import * from 'array-utils-mini';
const arr = [1, 2, 2, 3, 4];
console.log(unique(arr)); // [1, 2, 3, 4]
console.log(max(arr)); // 4
console.log(min(arr)); // 1
push(arr, 5);
console.log(arr); // [1, 2, 2, 3, 4, 5]🧠 Why Use This?
- Great for learning how array methods work under the hood.
- Helpful for DSA practice and JavaScript interviews.
- Lightweight and zero dependencies.
- Easy to contribute new methods or enhancements.
🤝 Contributing
Contributions are welcome! If you’d like to add more array methods or improve the existing ones:
- Fork the repo
- Create a new branch
- Submit a pull request
Or just message me directly if you have ideas, find bugs, or want to collaborate!
📄 License
This project is open source and available under the MIT License.
