js-data-structures

Installation
SKILL.md

Data Structures (JavaScript)

Map vs Object, Set vs Array

  • Prefer Map when keys are non-string (numbers, objects), when you add/remove entries often, when you need .size
  • Prefer Object when keys are string/symbol, the shape is static and known at creation, or you need JSON serialization
  • Prefer Set when uniqueness matters or you need fast .has() lookups
  • Prefer Array when order and duplicates matter; when have fixed size array; need index access

Linked List

Single-linked list:

class LinkedList {
  #head = null;
  #length = 0;

  push(data) {
Related skills
Installs
6
GitHub Stars
35
First Seen
Mar 16, 2026