JavaScript Function

Quiz
•
Computers
•
Professional Development
•
Hard
Thomas Martinez
FREE Resource
12 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of these are correct methods to create a function?
function myFunction {
// Some code }
function myFunction[] {
// Some code }
function myFunction() {
// Some code }
function myFunction(x, y, z) {
// Some code }
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Given the following code, which is considered the parameters of the function
function myFunction(a, b, c) {
var x = a + b + c;
}
x
a
b
c
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following code, what is the final value of x?
var x = 0;
function myXFunction() {
x = x + 10;
}
x = x + 1;
11
0
10
1
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What should go into the indicated location make the final value of x = 11?
var x = 0;
function myXFunction() {
x = x + 10;
}
WRITE CODE HERE
x = x + 1;
function myXFunction()
MYXFUNCTION()
myXFunction()
myxfunction()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the final value of x be?
var x = 0;
function myXFunction() {
return 10;
}
x = x + 1;
x = myXFunction();
11
0
10
1
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Given the following function.
function myFunction () {
//Some Code }
Which of the code below will allow the following button to invoke myFunction?
<input type="button" id="mybutton" value="Click Me"/>
var h = document.getElementById(“mybutton”); h.addEventListener(“click”, myFunction);
var h = document.getElementById(“mybutton”);
h.onclick(myFunction);
document.getElementById(“mybutton”).addEventListener(“click”, myFunction);
document.getElementById(“mybutton”).onclick(myFunction);
7.
FILL IN THE BLANK QUESTION
1 min • 1 pt
Fill in the blanks to allow the following button invoke the myFunction function when clicked
<button id="myButton" value="Click Me" ________ />
function myFunction() {
//Some Code }
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Python Session 5

Quiz
•
Professional Development
15 questions
Flutter Q_0

Quiz
•
Professional Development
14 questions
процедуры и функции

Quiz
•
Professional Development
10 questions
JWD JS Test Bank 1-10

Quiz
•
Professional Development
14 questions
terraform

Quiz
•
Professional Development
12 questions
Week 1

Quiz
•
Professional Development
15 questions
JavaScript

Quiz
•
Professional Development
10 questions
Flutter_Q5

Quiz
•
Professional Development
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade