Short code snippets for all your development needs

Start of main content## JavaScript Data Structures

The JavaScript data structures collection includes implementations and examples of some of the most commonly-used data structures. Data structure snippets are best used as a learning resource, as they might require optimizations to run in production.

### Native JavaScript Data Structures

JavaScript, Article

JavaScript provides a handful of native data structures that you can start using in your code right now.

### JavaScript Data Structures - Queue

JavaScript, Article

A queue is a linear data structure which follows a first in, first out (FIFO) order of operations.

### JavaScript Data Structures - Stack

JavaScript, Article

A stack is a linear data structure which follows a last in, first out (LIFO) order of operations.

### JavaScript Data Structures - Linked List

JavaScript, Article

A linked list is a linear data structure where each element points to the next.

### JavaScript Data Structures - Doubly Linked List

JavaScript, Article

A doubly linked list is a linear data structure where each element points both to the next and the previous one.

### JavaScript Data Structures - Graph

JavaScript, Article

A graph is a data structure consisting of a set of vertices connected by a set of edges.

### JavaScript Data Structures - Tree

JavaScript, Article

A tree is a data structure consisting of a set of linked nodes representing a hierarchical tree structure.

### JavaScript Data Structures - Binary Tree

JavaScript, Article

A binary tree is a data structure consisting of a set of linked nodes representing a hierarchical tree structure, in which each node can have at most two children.

### JavaScript Data Structures - Binary Search Tree

JavaScript, Article

A binary search tree is a data structure consisting of a set of ordered linked nodes representing a hierarchical tree structure, in which each node can have at most two children.