Defining Variables Quiz

Defining Variables Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

JavaScript Variables

JavaScript Variables

3rd Grade - University

13 Qs

Final Review - Unit 1

Final Review - Unit 1

9th - 12th Grade

15 Qs

JavaScript - Programação Web - Parcial 2

JavaScript - Programação Web - Parcial 2

12th Grade

10 Qs

Intro to JavaScript

Intro to JavaScript

9th - 12th Grade

16 Qs

Variables

Variables

5th - 12th Grade

20 Qs

Introduction to TypeScript

Introduction to TypeScript

12th Grade

15 Qs

C5 Web Tech Quiz 1 (Practice)

C5 Web Tech Quiz 1 (Practice)

10th - 12th Grade

20 Qs

Javascript Basics

Javascript Basics

9th - 12th Grade

16 Qs

Defining Variables Quiz

Defining Variables Quiz

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Josué Suástegui

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for defining a variable in JavaScript?

var variableName;

variableName = var

variableName = var;

variableName = var();

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to declare a variable in JavaScript?

let

const

function

var

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the rules for naming variables in JavaScript?

Variable names can start with a number.

Variable names can contain spaces.

Variable names must be at least 10 characters long.

Variable names must start with a letter, underscore (_), or dollar sign ($).

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between var, let, and const in JavaScript?

The difference between var, let, and const in JavaScript is that 'var' has function scope, 'let' has block scope, and 'const' is used to declare a constant variable.

The difference between var, let, and const in JavaScript is that 'var' is used for asynchronous operations, 'let' is used for synchronous operations, and 'const' is used for callback functions.

The difference between var, let, and const in JavaScript is that 'var' is used for global variables, 'let' is used for local variables, and 'const' is used for class variables.

The difference between var, let, and const in JavaScript is that 'var' is used for numbers, 'let' is used for strings, and 'const' is used for booleans.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you assign a value to a variable in JavaScript?

x = 10

x = 'five'

x = true

x = 5

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a variable declared with var keyword?

block scope

global scope

class scope

function scope

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a variable declared with let keyword?

function scope

block scope

global scope

class scope

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?