Arrays are everywhere and we have to use them all the time.
I created this article specially for you, so you have a quick reference of the most common things you usually do with Arrays on a daily basis 😊
Table Of Contents 📋
- Find in array 🔍
- Filter an array 🕵️
- Loop arrays 🔁
- Sort an array of objects ⬆️ ⬇️
- Add an element to an array 🗳️
- Remove an element from an array 🗑️
- Create an array from an existing array (Map) 📦
- Accumulate array values (Reduce) 🐝
- Combine arrays (Concat) 🍔
Find in array 🔍
Filter an array 🕵️
Loop arrays 🔁
Sort an array of objects ⬆️ ⬇️
Add an element to an array 🗳️
Remove an element from an array 🗑️
Create an array from an existing array (Map) 📦
Accumulate array values (Reduce) 🐝
Combine arrays (Concat) 🍔
Hope you enjoyed this reading 🥳. Feel free to save this article into your bookmarks 🔖 so you have it available at your fingertips.
Top comments (12)
In Sort array of objects
usersSortedByScoreDescstill returns asc i believe?
But great reference all together!
Fixed! Thanks again!
Did you also include the fix? The result is still the same for me even after a hard refresh!
Please refresh again.
Worked for you now?
Yes it works now! Altough the json.stringify was actually nice to make it more readable :)
I used it for debugging purposes, but now you give me a good idea 😁 - I will put it back everywhere later.
There is another interesting blog I published yesterday 👉 dev.to/victorhazbun/modern-javascr...
Broken chrome tab after too many embed code editor :) It would be better if it had been placed less opts.
I will try to split my blog posts, i.e. Part 1, Part 2, etc. Since the embed code editor gives the reader the ability to play with the code. 😅
You bet, I will continue adding more of this for you.