In JavaScript, you may encounter a situation where you need to output a greeting message, but the message changes after some other operations. Initially, it says Hello World!, after some operations, it changes to Hello JavaScript! The goal is to reorder the lines of code provided in a way that fulfills the situation. Remember, you also have to output the messages after each assignment.
Declaring variables
Creating mutable greeting messages
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
console.log(greeting);
greeting = "Hello JavaScript!"; // Reassigning the variable
let greeting = "Hello World!"; // This is a string variable
console.log(greeting);
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.