hands-on lab

Working With JavaScript Higher Order Functions

Difficulty: Intermediate
Duration: Up to 45 minutes
Students: 112
Rating: 5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

In this lab, you will be working with JavaScript Higher Order Functions. A higher order function is a function that takes another function as an argument or returns a function. You will be working with the following higher order functions that are built into Javascript:

  • Map
  • Filter
  • Reduce

Learning Objectives

Upon completion of this lab, you will be able to:

  • Use the map method to iterate over an array and return a new array with the resulting values of the operation performed on each element.
  • Use the filter method to iterate over an array and return an array with the resulting values that returned true based on the condition performed on each element.
  • Use the reduce method to iterate over an array and return the resulting singular value due to the reducer function and the initial value provided.

Intended Audience

  • Beginners learning front-end development
  • Software Engineers who need to learn front-end technologies to expand their skillset

Prerequisites

The following content can be used to fulfill the prerequisite:

Covered topics

Lab steps

Introduction to JavaScript Labs
Mapping Numbers Array to Increase Element Value by One
Filter Numbers Array for Values Greater Than or Equal to Fifty
Reduce Numbers Array for Total Value of All Elements