🎯

js-set-map-lookups

🎯Skill

from theorcdev/8bitcn-ui

VibeIndex|
What it does

js-set-map-lookups skill from theorcdev/8bitcn-ui

πŸ“¦

Part of

theorcdev/8bitcn-ui(23 items)

js-set-map-lookups

Installation

πŸ“‹ No install commands found in docs. Showing default command. Check GitHub for actual instructions.
Quick InstallInstall with npx
npx skills add theorcdev/8bitcn-ui --skill js-set-map-lookups
12Installs
1,576
-
Last UpdatedJan 22, 2026

Skill Details

SKILL.md

Use Set and Map for O(1) membership lookups instead of array.includes(). Apply when checking membership repeatedly or performing frequent lookups against a collection.

Use Set/Map for O(1) Lookups

Convert arrays to Set/Map for repeated membership checks.

Incorrect (O(n) per check):

```typescript

const allowedIds = ['a', 'b', 'c', ...]

items.filter(item => allowedIds.includes(item.id))

```

Correct (O(1) per check):

```typescript

const allowedIds = new Set(['a', 'b', 'c', ...])

items.filter(item => allowedIds.has(item.id))

```