Your task is to create a simple multi-line JavaScript program using the basic concepts. The requirement is to define a variable named greeting that contains a string 'Hello, User!', create a function named displayGreeting which, when called, prints the greeting. Can you fill the blanks in code to make it happen?
Multi-line programs
Creating a function to display a greeting message
Report a typo
Fill in the gaps with the relevant elements
// Define a variable and assign a string value
greeting = "Hello, User!";
// Define a to display the greeting
function displayGreeting() {
(greeting);
}
// Call the function
displayGreeting(); ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
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.