← Back to Arrays
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'] 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
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
LoopsArraysforEach
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.