Javascript - var, functions, arrays, if

Quiz
•
Computers
•
12th Grade
•
Easy
Emmanuelle Arroyo
Used 2+ times
FREE Resource
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"
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Variables and data types

Quiz
•
4th - 12th Grade
15 questions
Database Concepts Quiz (Lecture W1)

Quiz
•
12th Grade
10 questions
JavaScript Cert Prep

Quiz
•
9th - 12th Grade
16 questions
UH DMI

Quiz
•
12th Grade
15 questions
python basics

Quiz
•
11th Grade - University
16 questions
XIБ_Script

Quiz
•
9th - 12th Grade
10 questions
Bài 15: Tạo màu cho chữ và nền

Quiz
•
12th Grade
10 questions
Functions and Parameters Summative preview

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade