Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a function expression named getBallSports getBallSports function should contain a parameter named sportsAr. This sportsAr parameter should have the structure of the newly mapped
Create a function expression named getBallSports
getBallSports function should contain a parameter named sportsAr. This sportsAr parameter should have the structure of the newly mapped array from the previous section.
Call the function getBallSports with the argument being the mappedSports from the previous section.
Use console.log to verify your results
Until you finish the next step the console will show undefined
The getBallSports is NOT the "filtering function" iteself. It is where the "filtering" operation will happen to the array named sportsAr.
The "filtering function" will be defined within getBallSports so it will be a "function within a function"
getBallSports should filter the array called sportsAr
The filtering logic will return true if the name property of the individual sport is either "Baseball" or "Soccer".
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started