filter Keeps Matching Items
filter Keeps Matching Items
filter creates a new array containing only the items that pass a test. The callback should answer yes or no for each item.
The returned array contains original items, not the boolean answers themselves. That distinction matters when you need a shorter list of records to render or process.
Your task: Use filter to create passingScores from scores. Keep scores that are at least 70, and do not change scores.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
filter Keeps Matching Items
filter creates a new array containing only the items that pass a test. The callback should answer yes or no for each item.
The returned array contains original items, not the boolean answers themselves. That distinction matters when you need a shorter list of records to render or process.
Your task: Use filter to create passingScores from scores. Keep scores that are at least 70, and do not change scores.