Skip to content
Frontend
Skill

/js-set-map-lookups

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.

From plugin
8bitcn-ui
2.1k23 skills4 hooks

Claude Code

$ npx -y skills add theorcdev/8bitcn-ui --skill js-set-map-lookups --agent claude-code

SKILL.md

js-set-map-lookups.SKILL.md
name: js-set-map-lookups
description: 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):**

const allowedIds = ['a', 'b', 'c', ...]
items.filter(item => allowedIds.includes(item.id))

**Correct (O(1) per check):**

const allowedIds = new Set(['a', 'b', 'c', ...])
items.filter(item => allowedIds.has(item.id))
@theorcdev
Ships with8bitcn-ui

Accessible retro components that you can copy and paste into your apps.Free. Open Source. Built on shadcn/ui. Documentation · Components · Blocks · Themes · Discord

Stars on GitHub

Momentum

stars in total
2.1k
Star history of theorcdev/8bitcn-ui on GitHub, a chart by star-history.com

Other skills on 8bitcn-ui.

8bit-docs-patterns

8bit-docs-patterns

Create documentation with gaming-specific examples, retro styling, and 8-bit terminology. Apply when documenting gaming blocks,…

@theorcdev@theorcdevInstall Skill
bundle-barrel-imports

bundle-barrel-imports

Import directly from source files instead of barrel files. Apply when using libraries like lucide-react, @mui/material, or…

@theorcdev@theorcdevInstall Skill

More skills from other plugins.

next-bundle-optimizer
Auto-invoked

next-bundle-optimizer

Audit and reduce Next.js browser initial-load work. Use for slow route startup, oversized client bundles, duplicate browser…

nextjs10d143k
@vercel@vercelInstall Skill
migrate-radix-to-base

migrate-radix-to-base

Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert…

ui2w127k
@shadcn-ui@shadcn-uiInstall Skill
chrome-release-cls

chrome-release-cls

Given a Chrome Releases blog post URL (chromereleases.googleblog.com), extract every CVE/bug and find the underlying Gerrit CL…

electron10d124k
@electron@electronInstall Skill
taste-skill
Auto-invoked

taste-skill

tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One…

Questions about js-set-map-lookups.

Which coding agents can use js-set-map-lookups?
js-set-map-lookups installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.