...

Exercise: Mars to Houston

Your fellow astronauts are impressed. They want to send more messages to the NASA Headquarters! Your mission is to write a program that first sends the words "Incoming transmission from Mars." and then send a user-prompted message.

Once again, you are the perfect person for the mission because of your deep knowledge of console.log and prompt.

  • Use console.log(""); to send the initial transmission.
  • Then, use prompt("Enter a message to send to the NASA Headquarters"); to ask the user for their message. Make sure to use a variable declaration such as let message = to store the user's message.
  • Finally, use console.log along with the message variable to send the user's message.
Loading...

Output (Console)