Insha Profile picture
1 Sep, 17 tweets, 4 min read
Hey there JavaScript Developers πŸ‘‹

Let's learn about some important Array Methods πŸ˜ŽπŸ‘‡
A little introduction about Arrays:

To store ordered collections, there exists a special data structure named Array in JavaScript.

Array elements are numbered, starting with zero. And it can store elements of any type.
Some of the Array Methods πŸ‘‡

1️⃣ push()

The push() method adds a new element at the end of an array.
2️⃣ pop()

The pop() method extracts the last element of the array and returns it.
3️⃣ shift()

The shift() method removes the first array element and shifts all other elements to a lower index and returns the value that was shifted out.
4️⃣ unshift()

This method adds the element to the beginning of the array.
5️⃣ splice()

The arr.splice method can be used to: insert, remove and replace elements.
The splice() method takes in:

start - The index from where the array is changed.
deleteCount (optional) - The number of items to remove from the start.
item1, ..., itemN - inserts elem1, ..., elemN at their place. If not specified, it'll only remove elements from the array.
6️⃣ concat()

The concat() method returns a new array by merging two or more values/arrays.
7️⃣ slice()

It returns a new array copying to it all items from index start to end (not including end)
8️⃣ sort()

The sort() method sorts the items of an array in a specific order (ascending or descending).
9️⃣ join()

The join() method returns a new string by concatenating all of the elements in an array, separated by a specified separator.
πŸ”Ÿ filter()

The filter() method returns a new array with all elements that pass the test defined by the given function.

Remeber filter() does not change the original array.
1️⃣1️⃣ reduce()

This method calculates a single value over the array by calling function for each element and passing an intermediate result between the calls.
Remember that calling reduce() on an empty array without initialValue will throw TypeError.
1️⃣2️⃣ map()

The map() method creates a new array with the results of calling a function for every array element.
There are plenty of Array methods in the JavaScript language. Some of them are used rarely while some of the above-mentioned methods are commonly used.
If you learned something make sure to retweet the first one. πŸ˜ŠπŸ™Œ

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Insha

Insha Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Insharamin

14 Sep
6 Underrated Websites that you should know.

A Thread πŸ‘‡
1️⃣ Gifrun

With this tool, you can convert any video into a GIF format.

πŸ“Ž gifrun.com
2️⃣ Uberduck

Uberduck.AI is a tool that allows you to make any text sound like it's been read by a celebrity or fictional character, and the results are incredible.

πŸ“Ž uberduck.ai/#mode=tts-basic
Read 8 tweets
7 Sep
Do you use Tailwind CSS?

Know these 5 websites to get Tailwind components pre-madeπŸ”₯😎
1️⃣ Tailwind Components

A free repository for community components using TailwindCSS.
You can find Tailwind charts, grids, inputs, forms, templates, and much more.

πŸ“Žtailwindcomponents.com
2️⃣ Tailblocks

Tailblocks shares handpicked Tailwind blocks, Tailwind templates, Tailwind Components, and other free resources related to Tailwind CSS.

πŸ“Žtailblocks.cc
Read 7 tweets
4 Sep
Are you a Web Developer?

Check out these 10 amazing Dev Resources for youπŸ˜ŽπŸ‘‡
1️⃣ Repl

Replit is a simple yet powerful online IDE, Editor, Compiler, Interpreter, and REPL. You can code right in your browser.
The second you create a new repl, it's instantly live and sharable with the world.

πŸ“Žreplit.com
2️⃣ DevDocs

DevDocs combines multiple API documentations in a fast, organized, and searchable interface. Here you can find multiple developer documentation in a clean and organized web UI with instant search, offline support.

πŸ“Ždevdocs.io
Read 12 tweets
28 Aug
Are you a Frontend Developer?

Here are 5 Awesome APIs for your next project πŸ‘‡
APIs let your product or service communicate with other products and services without having to know how they’re implemented. This can simplify app development, saving time and money. When you’re designing new tools and products or managing existing onesβ€”APIs give you flexibility
1️⃣ The NASA APIs

NASA offers a bunch of useful APIs for application developers. The objective of this site is to make NASA data, including imagery, eminently accessible to application developers.

πŸ“Ž api.nasa.gov
Read 8 tweets
17 Aug
Are you a JavaScript developer? πŸ’ͺ

If yes, then you must know about JavaScript Set Objects.

Let's discuss it in detail πŸ‘‡
What is a Set?

A Set is a collection of unique values. That means the set can never have any duplicates and can hold any values of any data type. You can iterate through the elements of a set in insertion order.
Okay, this sounds interesting. So the question is how to create a set ?

To create a set we write- new Set() and in the parentheses, we need to pass an iterable. Image
Read 13 tweets
14 Aug
5 Awesome Websites you won't believe exist. πŸ˜‰βš‘

A Thread πŸ‘‡
1️⃣ CodeElf

If you encounter difficulty in naming the variables then this is perfect for you. With CodeElf you can search over GitHub, Bitbucket, GitLab to find real-world usage variable names.

πŸ“Žunbug.github.io/codelf/
2️⃣ Hidden Tools

Discover a wide collection of tools made by the community - for you. You'll be amazed to see the collection of several dope tools.

πŸ“Žhiddentools.dev
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(