Ajay Yadav Profile picture
โ€ข No-Code AI Tools โ€ข Mission on Simplified Web @theDivSoup โ€ข Technical Writer โ€ข DM open for collab โ€ข Mail ๐Ÿ“ฉ: partnership.aj@gmail.com

Mar 27, 2022, 11 tweets

๐Ÿ’› Day 2๏ธโƒฃ6๏ธโƒฃ / 3๏ธโƒฃ0๏ธโƒฃ days of basics in JavaScript series!

โ†’ What is an array?

โ†’ How many types of creating an array?

โ†’ How to access array items & full array?

โ†’ How to change the array items?

โ†’ The data type of the array?

#javascript30

๐Ÿงตโ‡ฉ

๐Ÿ“Œ What is an array?

โ†’ It is a special variable that can be store more than one value.

โ†’ If you have multiple data items then you can use an array for storing those items.

โ†’ It can hold many values in a single variable.

โ†’ Or, storing a collection of multiple items in a single variable.

โ†’ Js array can contain mixed types of data or items, like string, decimal, float, boolean, etc.

๐Ÿ“Œ How many types of creating an array?

โ†’ There are 2 ways for creating an array for now.

1๏ธโƒฃ Using array literals
2๏ธโƒฃ Using new keyword

1๏ธโƒฃ Using array literals [ ]

โ†’ That means we can create an array using square brackets separated by semicolons.

โ†’ Space and lines are not important, they can be spanned in multiple lines.

โ†’ Generally, many people use this method for creating arrays.

2๏ธโƒฃ Using new keyword

โ†’ We can also use the new keyword for creating the array.

๐Ÿ“Œ How to access array items & full array?

๐Ÿ‘€ Access array items: We can access the items of an array using the index.

- 1st item = 0 index
- 2nd item = 1 index
- 3rd item = 2 index
- 4th item = 3 index

and so on...

โ›” Arrays index starts from 0.

๐Ÿ‘€ Access full array: We can access the full array using the name of the array.

๐Ÿ“Œ How to change the array items?

โ†’ We can change the items of the array using the index number.

๐Ÿ“Œ The data type of the array?

โ†’ It is a non-primitive data type.

โ†’ An object is the data type of the array.

๐Ÿ’š That's all for now, we will meet in the next thread!

But if you like make sure to:

1. Follow me @ATechAjay

2. Retweet the first tweet.

3. Turn on the notification to never miss these amazing tweets.

Thank you so much for staying to the end of this thread.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling