filmov
tv
map(), reduce(), some(), every(): The 4 Arrays Methods That Stopped Me from Using forEach()
Показать описание
There's so much more to learn beyond just how to use a programming language. When I first started writing JavaScript, I relied heavily on the array method forEach. But little did I know there were better, more declarative array methods I code be using in my projects.
In this video, I walk through the map, reduce, some, and every array methods so you know how to use them in your projects. The goal of this video is to inspire you to use the other array methods before forEach.
Often times, the name forEach can be too generic to first-time readers of your code. Yes, you know that you are looping over an array, but why? Do you want to generate a new array, filter some data out, or find a single item? There are array methods that not only iterate over a list but also serve a specific purpose.
Timestamps:
0:00 Intro
0:49 map() - Generate a New Array
2:33 reduce() - Return a Unique Single Value
6:04 some() - Determine if At Least One Type of Element Exists
7:19 every() - Determine if All Elements are the Same
== Let's Connect ==
== Who I Am ==
I'm Ijemma, a frontend software engineer currently working in New York City. I make videos on all things JavaScript and, more broadly, frontend web development.
#javascript #webdevelopment #softwareengineer
In this video, I walk through the map, reduce, some, and every array methods so you know how to use them in your projects. The goal of this video is to inspire you to use the other array methods before forEach.
Often times, the name forEach can be too generic to first-time readers of your code. Yes, you know that you are looping over an array, but why? Do you want to generate a new array, filter some data out, or find a single item? There are array methods that not only iterate over a list but also serve a specific purpose.
Timestamps:
0:00 Intro
0:49 map() - Generate a New Array
2:33 reduce() - Return a Unique Single Value
6:04 some() - Determine if At Least One Type of Element Exists
7:19 every() - Determine if All Elements are the Same
== Let's Connect ==
== Who I Am ==
I'm Ijemma, a frontend software engineer currently working in New York City. I make videos on all things JavaScript and, more broadly, frontend web development.
#javascript #webdevelopment #softwareengineer
Комментарии