JavaScript Variables Quiz

Quiz
•
Computers
•
7th Grade
•
Hard
Ashish Chauhan
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the syntax for declaring a variable in JavaScript?
variableName = variableType
var/let/const variableName
variableName = var/let/const
variableName = value
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you assign a value to a variable in JavaScript?
x = true
x = 10
x = 5
x = 'five'
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a valid variable name in JavaScript? a) myVariable b) 123Variable c) $variable d) variable-name
d) variable-name
c) $variable
b) 123Variable
a) myVariable
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of declaring a variable in JavaScript?
To import external libraries
To create a function
To display data on the webpage
To store and manipulate data
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which keyword is used to declare a variable in JavaScript?
const
var
let
function
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What happens if you declare a variable without assigning a value to it?
The variable will have an initial value of undefined.
The variable will have an initial value of false.
The variable will have an initial value of 0.
The variable will have an initial value of null.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is not a valid variable naming convention in JavaScript? a) camelCase b) snake_case c) PascalCase d) kebab-case
a) camelCase
b) snake_case
d) kebab-case
c) PascalCase
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Informatika - Algoritma dan Pemrograman

Quiz
•
7th Grade
6 questions
TIN 7- HỌC KÌ 2

Quiz
•
7th Grade
10 questions
JavaScript ievads

Quiz
•
7th - 8th Grade
10 questions
Website Design

Quiz
•
KG - University
14 questions
Cuestionario sobre Lenguajes de Programación

Quiz
•
7th Grade - University
15 questions
Scratch Arithmetic Operators

Quiz
•
4th - 7th Grade
15 questions
Microbit-Countdown timer2

Quiz
•
6th - 8th Grade
10 questions
sagutan mo nalang 2

Quiz
•
6th - 8th 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
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
20 questions
Copyright and Fair Use

Quiz
•
6th - 8th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
21 questions
Input Output Storage Device

Quiz
•
5th - 8th Grade