
JavaScript Basics Quiz

Quiz
•
Other
•
University
•
Medium
elementas undefined
Used 1+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to declare a variable in JavaScript using var?
variable num = 10;
var num = 10;
int num = 10;
let num = 10;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a valid JavaScript variable name?
var myVar;
var _myVar;
var 123var;
var $myVar;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to assign a value to a variable?
var x; x == 10;
var x = 10;
var x <- 10;
x := 10;
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? var car = "Tesla"; console.log(car);
Tesla
undefined
null
car
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to declare a variable in JavaScript?
var 1name = "John";
var name1 = "John";
var #name = "John";
var name-1 = "John";
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? var num; console.log(num);
undefined
null
0
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the var keyword in JavaScript?
To declare a function
To declare a variable
To define a loop
To print output
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
JavaScript

Quiz
•
University
20 questions
Quiz Kelas 11 RPL

Quiz
•
University
20 questions
WEEK OF INNOVATION

Quiz
•
University
25 questions
Java Programming Quiz

Quiz
•
University
20 questions
MSDS

Quiz
•
University
20 questions
Thai for beginner

Quiz
•
University
20 questions
Quiz1

Quiz
•
University
20 questions
Cognitive Approach BTEC

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University