
Javascript - var, functions, arrays, if
Authored by Emmanuelle Arroyo
Computers
12th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way of declaring a variable and assigning it to the value 10 ?
var a=10;
variable a:10;
var a:10;
var 10;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to declare a function named myFun ?
myFun(){
}
function myFun{
}
function myFun(){
}
function myFun(
)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of creating functions?
to test a condition
to repeat some lines of code over and over
to execute some lines of code whenever you want
to execute lines of code when the page loads
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can we change the text of a paragraph with an id "myPara"?
document.getElementById("myPara").style.text="new text"
document.getElementById("myPara").text="new text"
document.getElementById("myPara").innerHTML="new text"
document.getElementById("myPara").value="new text"
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these correctly selects a paragraph with an id "myPara"?
getElementById("myPara")
document.getElementById("myPara")
document.getElementById( myPara )
document.Id("myPara")
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do we execute a function named myFunction?
myFunction{};
myFunction();
function myFunction()
myFunction;
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do we create an array "myArray "of 2 items "one" and "two"?
var myArray = ["one", "two"]
var myArray = [one, two]
array myArray = ["one", "two"]
myArray = "one", "two"
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Keyboarding Terms
Quiz
•
9th - 12th Grade
15 questions
python basics
Quiz
•
11th Grade - University
10 questions
Topologies and Architecture
Quiz
•
9th - 12th Grade
10 questions
Tree
Quiz
•
12th Grade
15 questions
Code Combat Curso Junior
Quiz
•
9th - 12th Grade
16 questions
C-Programming Basics
Quiz
•
12th Grade
16 questions
A2 Computer Science 4.10 Databases
Quiz
•
10th - 12th Grade
15 questions
Digital Etiquette
Quiz
•
4th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade