Arrays are a collection of ordered elements. They can be used to store any type of data, such as numbers, strings, objects, and other arrays. Arrays are accessed by their index, which is a non-negative integer.
Objects are a collection of key-value pairs. The keys can be strings, and the values can be any type of data. Objects are accessed by their keys, using the dot notation or the square bracket notation.
Linked lists are a linear data structure that consists of nodes. Each node contains a value and a pointer to the next node in the list. Linked lists can be used to implement stacks, queues, and other data structures.
Stacks are a last-in-first-out (LIFO) data structure. Elements can only be added and removed from the top of the stack. Stacks are often used to implement back buttons and function calls.
Queues are a first-in-first-out (FIFO) data structure. Elements can only be added to the back of the queue and removed from the front of the queue. Queues are often used to implement print queues and message queues.
Sets are a collection of unique values. They can be used to store any type of data, such as numbers, strings, objects, and other sets. Sets are accessed by their values, using the has() and add() methods.
Maps are a collection of key-value pairs, just like objects. However, the keys in a map can be of any type, not just strings. Maps are often used to implement dictionaries and caches.
Trees are a hierarchical data structure that consists of nodes. Each node can have one or more child nodes. Trees are often used to implement file systems, menus, and other hierarchical structures.
Graphs are a non-linear data structure that consists of nodes and edges. Edges connect two nodes. Graphs are often used to represent networks, such as social networks and road networks.