Sunday, October 12, 2025
HomeData Modelling & AIIntroduction to Built-in Data Structures in JavaScript

Introduction to Built-in Data Structures in JavaScript

JavaScript (JS) is the most popular lightweight, interpreted compiled programming language, and might be your first preference for Client-side as well as Server-side developments.

Let’s see what inbuilt data structures JavaScript offers us:

Data Structure

Internal Implementation

Static or Dynamic

JavaScript Arrays

Contiguous Memory Allocation

Dynamic Nature

JavaScript Strings

Array of Unicode characters

Dynamic Nature

JavaScript Objects

Hashing key-value pair

Dynamic Nature

JavaScript Sets

Hash Tables or Search trees

Dynamic Nature

JavaScript Maps

Hash Tables

Dynamic Nature

JavaScript Arrays:

  • An array is a collection of items of the same variable type stored that are stored at contiguous memory locations.
  • Each item in an array is indexed starting with 0.

JavaScript Strings: There are two ways to create a string in Javascript:

  • By string literal
  • By string object

JavaScript Objects: There are different ways to create new objects:

  • Create a single object, using an object literal.
  • Create a single object, with the keyword new.
  • Define an object constructor, and then create objects of the constructed type.
  • Create an object using Object.create().

JavaScript Sets:

  • A set is a collection of items that are unique i.e no element can be repeated. Set in ES6 are ordered: elements of the set can be iterated in the insertion order.
  • Set can store any type of value whether primitive or objects
  • it: It is an iterable object whose all elements are added to the new set created, If the parameter is not specified or null is passed then a new set created is empty.

JavaScript Maps:

  • Map is a collection of elements where each element is stored as a Key, value pair. Map objects can hold both objects and primitive values as either key or value
  • it – It is any iterable object whose values are stored as key, value pair, If the parameter is not specified then a new map created is Empty
Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

Last Updated :
19 Sep, 2023
Like Article
Save Article


Previous

<!–

8 Min Read | Java

–>


Next


<!–

8 Min Read | Java

–>

RELATED ARTICLES

Most Popular

Dominic
32353 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6721 POSTS0 COMMENTS
Nicole Veronica
11885 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11943 POSTS0 COMMENTS
Shaida Kate Naidoo
6841 POSTS0 COMMENTS
Ted Musemwa
7105 POSTS0 COMMENTS
Thapelo Manthata
6797 POSTS0 COMMENTS
Umr Jansen
6798 POSTS0 COMMENTS