π Provides UArray, an Array type that supports negative indices/indexes, just wrap your regular JavaScript array with UArray() and you are all set! π
- π’ Negative indexing (-1, -2, etc.)
- π§³ Accepts array or multiple values
- πͺ Behaves like a native array
- π οΈ Supports all standard methods
- π§Ό Safe fallback for non-numeric keys
- π§ͺ Ideal for reverse access and testing
- π Drop-in replacement, zero config
Install it by executing any of the following, depending on your preferred package manager:
pnpm add @igorskyflyer/uarray
yarn add @igorskyflyer/uarray
npm i @igorskyflyer/uarray
βΉοΈ Uses the built-in
Proxy
object, check browser compatibility on the Can I Use website.
import { UArray } from '@igorskyflyer/uarray'
const food = UArray(['π', 'π', 'πΏ', 'π₯', 'π₯']) // array passed
const objects = UArray('π', 'π©', 'β½', 'π₯', 'π―') // no array passed, just direct values
console.log(food[-1]) // prints 'π₯'
console.log(food[-3]) // prints 'πΏ'
console.log(objects[-1]) // prints 'π―'
console.log(objects[-3]) // prints 'β½'
π The changelog is available here, CHANGELOG.md.
Licensed under the MIT license which is available here, MIT license.
Consider buying me a coffee. β

Thank you for supporting my efforts! ππ
π§΅ Provides ways of checking whether a String is present in an Array of Strings using custom Comparators. π
π‘ Parse, manage, compare and output SemVer-compatible version numbers. π‘
πͺ Provides ways of testing whether an array of chars is present inside a given String. β
𧬠A lightweight JavaScript utility allowing deep copy-by-value of nested objects, arrays and arrays of objects. πͺ
π¨ Provides common Color-related TypeScript types. π
Created by Igor DimitrijeviΔ (@igorskyflyer).