These are some data structures that are used to store data in javaScript.
Data stored can be;
- Scores of players in a game
- List of todo's
- Collection of Movies
- A list of favourite animations
- Deatils of an person
An Array is used to store an ordered collection of data.
It is a better and convenient way of storing data of the same type.
Arrays can be called a list;
- List of players in a team
- List of students in a class
- List of favorite Movies
- Bucket list
Arrays can be manipulated using these methods;
- array.pop()
- array.push()
- array.shift()
- array.unshift()
Objects are a collection of unordered but related properties. Usually with Key and value pairs for each property.
Objects can be;
- Used to store details of a person
- Store details of a car
Operations on Objects;
- Accessing values using the dot notation
- Adding new properties
- Deleting properties
Go to freecodecamp and work on the code challenges on Arrays and Objects to understand how to use them well.
** The End **