Functions Flashcards
1
Q
Execute the function named myFunction.
function myFunction() { alert("Hello World!"); }
A
myFunction();
2
Q
Create a function called “myFunction”. that does:
alert(“Hello World!”);
A
function myFunction() { alert("Hello World!); }
3
Q
Make the function return “Hello”.
function myFunction() {
}
A
return “Hello”;
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”;