πŸ“Œ 24 Array Methods in JavaScript:

Mega Thread 🧡 πŸ‘‡

#LearnToCode #CodeNewbie
1) concat():

πŸ”Ή Concatenates (joins) two or more arrays.

πŸ”Ή Returns a new array, containing the joined arrays.

πŸ”Ή Does not change the existing arrays.
2) copyWithin():

πŸ”Ή Copies array elements to another position in the array.

πŸ”Ή Overwrites the existing values.

πŸ”Ή Does not add items to the array.
3) every():

πŸ”Ή Executes a function for each array element.

πŸ”Ή Returns `true` if the function returns true for all elements, otherwise returns `false`.

πŸ”Ή Does not execute the function for empty elements.

πŸ”Ή Does not change the original array.
4) fill():

πŸ”Ή Fills specified elements in an array with a value.

πŸ”Ή Overwrites the original array.

πŸ”Ή Start and end position can be specified. If not, all elements will be filled.
5) filter():

πŸ”Ή Creates a new array filled with elements that pass a test provided by a function.

πŸ”Ή Does not execute the function for empty elements.

πŸ”Ή Does not change the original array.
6) find():

πŸ”Ή Returns the value of the first element that passes a test. Returns `undefined` if no elements are found.

πŸ”Ή Executes a function for each array element.

πŸ”Ή Does not execute the function for empty elements.

πŸ”Ή Does not change the original array.
7) findIndex():

πŸ”Ή Returns the the index (position) of the first element that passes a test. Returns -1 if no match is found.

πŸ”Ή Executes a function for each array element.

πŸ”Ή Does not execute the function for empty elements.

πŸ”Ή Does not change the original array.
8) from():

πŸ”Ή Returns an array from any object with a length property.
9) includes():

πŸ”Ή Returns `true` if an array contains a specified value, otherwise returns `false`.

πŸ”Ή This method is case sensitive.
10) indexOf():

πŸ”Ή Returns the first index (position) of a specified value. Returns -1 if the value is not found.

πŸ”Ή Starts at a specified index and searches from left to right.

πŸ”Ή Negative start values counts from the last element (but still searches from left to right).
11) isArray():

πŸ”Ή Returns `true` if an object is an array, otherwise `false`.
12) join():

πŸ”Ή Returns an array as a string.

πŸ”Ή Does not change the original array.
13) lastIndexOf():

πŸ”Ή Returns the last index (position) of a specified value. Returns -1 if the value is not found.

πŸ”Ή Starts at a specified index and searches from right to left.

πŸ”Ή Negative start values counts from the last element (but still searches from right to left).
14) map():

πŸ”Ή Creates a new array from calling a function for every array element.

πŸ”Ή Calls a function once for each element in an array.

πŸ”Ή Does not execute the function for empty elements.

πŸ”Ή Does not change the original array.
15) pop():

πŸ”Ή Removes (pops) the last element of an array.

πŸ”Ή Changes the original array.

πŸ”Ή Returns the removed element.
16) push():

πŸ”Ή Adds new items to the end of an array.

πŸ”Ή Changes the length of the array.

πŸ”Ή Returns the new length.
17) reduce():

πŸ”Ή Executes a reducer function for each array element.

πŸ”Ή Returns a single value: the function's accumulated result.

πŸ”Ή Does not execute the function for empty array elements.

πŸ”Ή Does not change the original array.
18) reverse():

πŸ”Ή Reverses the order of the elements in an array.

πŸ”Ή Overwrites the original array.
19) shift():

πŸ”Ή Removes the first item of an array.

πŸ”Ή Changes the original array.

πŸ”Ή Returns the shifted element.
20) slice():

πŸ”Ή Returns selected elements in an array, as a new array.

πŸ”Ή Selects from a given start, up to a (not inclusive) given end.

πŸ”Ή Does not change the original array.
21) some():

πŸ”ΉChecks if any array elements pass a test.

πŸ”Ή Executes the callback function once for each array element.

πŸ”Ή Returns true (and stops) if the function returns true for one of the array elements. Otherwise returns false.
22) sort():

πŸ”Ή Sorts the elements of an array.

πŸ”Ή Overwrites the original array.

πŸ”Ή Sorts the elements as strings in alphabetical and ascending order.
23) splice():

πŸ”Ή Adds and/or removes array elements.

πŸ”Ή Overwrites the original array.
24) unshift():

πŸ”Ή Adds new elements to the beginning of an array.

πŸ”Ή Overwrites the original array.
That's a wrap!

If you found it useful, please consider:

πŸ”ΉFollow me @cgrkzlkn for more content on HTML, CSS and JavaScript πŸ§‘β€πŸ’»
πŸ”ΉLike ❀️
πŸ”ΉRetweet the first tweet ⚑️

You can read unrolled version of this thread:

threadreaderapp.com/thread/1553468…

β€’ β€’ β€’

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

Keep Current with Cagri Kizilkan πŸ‡ΊπŸ‡¦

Cagri Kizilkan πŸ‡ΊπŸ‡¦ 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 @cgrkzlkn

Jul 27
πŸ“Œ 10 CSS Selectors You Must Know

Thread πŸ§΅πŸ‘‡

#100DaysOfCode #CodeNewbie Image
1⃣ Universal Selector ( * ) : Selects all elements. Image
2⃣ General Sibling Combinator ( X ~ Y) : Selects Y if it follows the X, and are children of the same parent element. Image
Read 12 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 on Twitter!

:(