Quiz: Functions

Test your knowledge of functions in JavaScript.

1

What will happen when you execute the following code in the console?

function hello() {
  alert('Hello, World!');
}
hello();
A)

The function will display “Hello, World!” in the console.

B)

The function will create an alert box with the message “Hello, World!”

C)

The function will return the message “Hello, World!”

D)

The function will print “Hello, World!” to the DOM.

Question 1 of 70 attempted

Get hands-on with 1200+ tech skills courses.