Insha Profile picture
Sep 1, 2021 β€’ 17 tweets β€’ 4 min read β€’ Read on X
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

Mar 11, 2023
10 repositories that will transform the way you approach technical interviews.

A Thread πŸ‘‡πŸ»
1. Coding University Interview

A complete computer science study plan to become a software engineer. This GitHub repo will take you from ground level to advanced concepts in a systematic manner.

πŸ”— github.com/jwasham/coding…
2. Tech Interview Handbook

This repository has practical content that covers all phases of a technical interview, from applying for a job to passing the interviews to offer negotiation.

πŸ”— github.com/yangshun/tech-…
Read 12 tweets
Mar 10, 2023
TED Talks are life-changing.

Here are 10 most popular TED Talks of all time ↓
1. The puzzle of motivation: Dan Pink

2. How to make stress your friend: Kelly McGonigal

Read 12 tweets
Feb 14, 2023
Use these 5 Websites to accelerate your learning in JavaScript 🧡
1. The Modern JavaScript

Learn everything from the basics to advanced topics with simple, but detailed explanations.

javascript.info
2. JavaScript - The Complete Guide

JavaScript is omnipresent, be it front-end, back-end, or full stack.

Learn modern JavaScript from this guided roadmap filled with content, examples, resources, & project ideas.

On completion, earn a certificate too!

showwcase.com/roadmap/7/java…
Read 7 tweets
Feb 13, 2023
Google Chrome has over 137,000 extensions. These 10 will save you hundreds of hours (all free):
1. Scribe

Gone are the days of tedious step-by-step guides! Scribe lets you create automatic tutorials for your team with the click of a button.

chrome.google.com/webstore/detai…
2. WordTune

Wordtune is an AI-powered writing tool that understands what you’re trying to say and suggests ways to make your writing clearer, more compelling, and authentic.

chrome.google.com/webstore/detai…
Read 12 tweets
Nov 30, 2022
10 tips and tricks that will transform the way you search on Google!

A Thread πŸ‘‡
1. Use quotation marks to search for an exact phrase.
2. The site: allows you to perform a search for a particular website or content.
Read 12 tweets
Nov 28, 2022
STEP UP YOUR CODING GAME!

Coding may not be as addictive as candy crush, but these 9 games will help you enhance your coding skills and have fun while doing it!

A Thread πŸ‘‡
1. CodinGame

CodinGame offers up fun free games to help learn more than 25 programming languages, including JavaScript, Ruby, and PHP.

codingame.com/start
2. CodeCombat

CodeCombat is aimed at helping students embrace learning as they play and write code from the very start of their adventure.

codecombat.com
Read 14 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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(