Functions Flashcards

1
Q

Execute the function named myFunction.

function myFunction() {
  alert("Hello World!");
}
A

myFunction();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create a function called “myFunction”. that does:

alert(“Hello World!”);

A
function myFunction() {
   alert("Hello World!);
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Make the function return “Hello”.

function myFunction() {

}

A

return “Hello”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Make the function display “Hello” in the inner HTML of an element with the ID “demo”.

function myFunction() {

}

A

document.getElementById(“demo”).innerHTML = “Hello”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly