JavaScript: Three methods that you should know

JavaScript: Three methods that you should know

Three methods that you should know

If you are a web developer, there are three useful methods that you should know about.

find()

The find() method returns the value of the first element in the provided array that satisfies the provided testing function.

findJS.png

filter()

The filter() method creates a new array with all elements that pass the test implemented by the provided function.

filterJS.png

reduce()

The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value.

reduceJS.png