CJCoding With Joseph
15per day

forEach: Count Passing Scores

Use forEach and an if statement to count how many scores are 60 or higher, then print the count.

Array:
[55, 78, 90, 62, 48]

Expected output:
Passing count: 3

Steps:
1. Create a variable passingCount set to 0
2. Use forEach to check each score
3. If score is at least 60, increase passingCount
4. Print the final count

Expected Output:

Passing count: 3
Topics:
LoopsArraysforEach
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (clog, fn, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.