โ Back to Loops
Question 29
forEach: Print Student Names
forEach: Print Student Names
Use forEach to print each student name with the prefix "Student: ". forEach runs a function once for each item in an array. Array: ['Ava', 'Liam', 'Noah'] Expected output: Student: Ava Student: Liam Student: Noah Steps: 1. Use the provided students array 2. Call forEach on the array 3. Print each name with the required prefix
Expected Output:
Student: Ava Student: Liam Student: Noah
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.