Task:
A greeting function is provided for you in the editor below. It has one parameter, parameterVariable. Perform the following tasks to complete this challenge:
- Use
console.log()
to printHello, World!
on a new line in the console, which is also known as stdout or standard output. The code for this portion of the task is already provided in the editor. - Use
console.log()
to print the contents of parameterVariable (i.e., the argument passed to main).
Input Format:
Data Type | Parameter | Description |
---|---|---|
string | parameterVariable | A single line of text containing one or more space-separated words. |
Output Format:
Print the following two lines of output:
- On the first line, print
Hello, World!
(this is provided for you in the editor). - On the second line, print the contents of parameterVariable.
Solution:
function greeting(parameterVariable) {
// This line prints 'Hello, World!' to the console:
console.log('Hello, World!');
console.log(parameterVariable);
// Write a line of code that prints parameterVariable to stdout using console.log:
}