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 (11)
In Sort array of objects
usersSortedByScoreDesc
still 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.