Welcome to this interesting lesson! We're going to explore JavaScript array methods, specifically: forEach()
, map()
, filter()
, reduce()
, and find()
.
JavaScript arrays can store multiple values. Array methods enable us to perform operations such as modifying or searching array elements. To call array methods, you use dot-notation on the array. For example: arrayVar.arrayMethod(func)
.
Array Methods accept a function as a parameter using the =>
operator. For example: arrayVar.arrayMethod( (functionParameters) => /* function code */ )
To inspect each element in an array, we use the forEach()
method, which runs a function on each array element.
