Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Victor Hazbun
Victor Hazbun

Posted on

     

Daily tasks with JavaScript arrays

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) 🍔

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)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
dennisk profile image
Dennis Keirsgieter
  • Location
    Netherlands
  • Work
    Lead Full Stack Developer at Learned
  • Joined

In Sort array of objectsusersSortedByScoreDesc still returns asc i believe?

But great reference all together!

CollapseExpand
 
victorhazbun profile image
Victor Hazbun
Founder at @BonsaiLabs

Fixed! Thanks again!

CollapseExpand
 
dennisk profile image
Dennis Keirsgieter
  • Location
    Netherlands
  • Work
    Lead Full Stack Developer at Learned
  • Joined

Did you also include the fix? The result is still the same for me even after a hard refresh!

Thread Thread
 
victorhazbun profile image
Victor Hazbun
Founder at @BonsaiLabs

Please refresh again.

Thread Thread
 
victorhazbun profile image
Victor Hazbun
Founder at @BonsaiLabs

Worked for you now?

Thread Thread
 
dennisk profile image
Dennis Keirsgieter
  • Location
    Netherlands
  • Work
    Lead Full Stack Developer at Learned
  • Joined

Yes it works now! Altough the json.stringify was actually nice to make it more readable :)

Thread Thread
 
victorhazbun profile image
Victor Hazbun
Founder at @BonsaiLabs

I used it for debugging purposes, but now you give me a good idea 😁 - I will put it back everywhere later.

CollapseExpand
 
victorhazbun profile image
Victor Hazbun
Founder at @BonsaiLabs

There is another interesting blog I published yesterday 👉dev.to/victorhazbun/modern-javascr...

CollapseExpand
 
zafer profile image
Zafer
  • Location
    Istanbul
  • Joined

Broken chrome tab after too many embed code editor :) It would be better if it had been placed less opts.

CollapseExpand
 
victorhazbun profile image
Victor Hazbun
Founder at @BonsaiLabs
• Edited on• Edited

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. 😅

CollapseExpand
 
victorhazbun profile image
Victor Hazbun
Founder at @BonsaiLabs

You bet, I will continue adding more of this for you.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Founder at @BonsaiLabs
  • Location
    Colombia
  • Work
    Software engineer at Bonsai Labs
  • Joined

More fromVictor Hazbun

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp