Looping through Arrays in JavaScript🔥 Open this🧵

@Shefali__J
Shefali@Shefali__J
46 views Nov 06, 2024 ~1 min read
Advertisement
1
Looping through Arrays in JavaScript🔥

Open this🧵
Media image
2
🎯for()

Arrays can be looped through using the for loop.
Media image
3
🎯forEach()

This loop calls a function once for each element of the array.
Media image
4
🎯map()

This method creates a new array by performing a function on each array element.
Media image
5
🎯filter()

This method creates a new array by filtering array elements based on a condition.
Media image
6
🎯reduce()

This method reduces the array to a single value by performing a function on each element of the array.
Media image
7
🎯for...of

This loop can be used to get the values from an array.
Media image
8
🎯for...in

This loop can be used to get the keys from an array.
Media image
9
That's a wrap.

Thanks for checking out💙

If you find this helpful, then consider:
❤️Like
✅Follow me @Shefali__J for more content like this.
🔁Repost the below quote👇
x.com/Shefali__J/sta…
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement