logo CodeStepByStep logo

parameterMystery12

Language/Type: JavaScript parameters return

The following console program uses parameters and produces four lines of output. What are they?

function main() {
    let scarlett = "mustard";
    let suspect = "peacock";
    let lounge = "ballroom";
    let pipe = "study";
    let dagger = "pipe";
    let weapon = "dagger";
    clue(weapon, suspect, pipe);
    clue(scarlett, pipe, suspect);
    dagger = clue(dagger, "lounge", scarlett);
    clue(dagger, lounge, "dagger");
}

function clue(suspect, room, weapon) {
    console.log(room + " in the " + weapon + " with the " + suspect);
    return room;
}
line 1
line 2
line 3
line 4

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.