Quick actions

cmd+k|ctrl+k

Navigation

Languages

forEach

Snippet info

Language

JavaScript

Visibility

public

Author

pallavid

Created

2022-01-16T17:47:20.63009Z

Updated

2022-01-16T17:47:20.63009Z

let names = ["anna", "beth", "chris", "daniel", "ethan"]

function rollCall(name, index) {
    console.log(`Is the number ${index + 1} student - ${name} present? Yes!`)
    ;}

names.forEach((name, index) => rollCall(name, index));
INFO