The Starline Awards rehearsal uses labeled stage props to trigger fictional effects: a foam "sword", a toy "gun", and a "shield". The preceding entrance-sign demo assigned a message in each switch case. Here choosePower(item) should return a message for each prop; as you saw in the switch lesson, return exits the function without a break. Work in script.js, not on page elements.
A switch maps known values to results; its default handles the rest:
function chooseRoute(direction) {
switch (direction) {
case "east": return "River path";
default: return "Main path";
}
}
console.log(chooseRoute("east")); // River path
choosePower(item) using switch: sword gives "Blade burst", gun gives "Pulse shot", shield gives "Shield wall", and all other items give "Training mode". The provided sword probe should print Sword: Blade burst.Loadout: Blade burst,Pulse shot,Shield wall from sword, gun, and shield calls.Pencil: Training mode from an unknown item.Shield wall alone from choosePower("shield").Run after each change; log the four requested checkpoints on separate Console lines.
Start with the smallest function signature, then test one case at a time.