Printing and Variables in JavaScript

Printing and Variables in JavaScript

9th - 12th Grade

5 Qs

quiz-placeholder

Similar activities

String

String

10th - 12th Grade

10 Qs

JAVA array

JAVA array

12th Grade - University

10 Qs

PC4.8-PC4.9 CSC403 T2

PC4.8-PC4.9 CSC403 T2

9th Grade

10 Qs

Java nested if program

Java nested if program

10th - 11th Grade

9 Qs

Introduction to PHP: Hypertext Preprocessor

Introduction to PHP: Hypertext Preprocessor

11th - 12th Grade

10 Qs

Topic 6.1 Video 1

Topic 6.1 Video 1

11th Grade

7 Qs

Latihan Interface

Latihan Interface

9th - 12th Grade

10 Qs

Valid and Invalid Variables in Java

Valid and Invalid Variables in Java

9th Grade

10 Qs

Printing and Variables in JavaScript

Printing and Variables in JavaScript

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Daniel Clark

Used 7+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What keyword do you need to use to define a variable in JavaScript?

variable

var

int

x

Answer explanation

To define a variable in JavaScript, you need to use the keyword 'var'. It is used to declare a variable and assign a value to it.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the proper function to call to print to the screen?

write

println

PRINT

post

Answer explanation

The proper function to call to print to the screen is 'println'. It is used to print a line of text and automatically adds a new line character at the end.

3.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Which of the following are types of variables? Select all that applies.

String

Floats

Integers

Boolean

Answer explanation

Variables can be of different types such as String, Floats, Integers, and Boolean. These types represent different kinds of data that can be stored and manipulated in a program.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Mayri inputs the following println("My name is Mayri"); What will be printed/displayed?

My name is Mayri

"My name is Mayri"

"My name is Mayri."

My name is Mayri.

Answer explanation

The correct answer is My name is Mayri because the println function will display the exact string that is passed as an argument.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Juan made the following variable ... var costOfApples = 3.6; What type of variable did he make?

String

Boolean

Float

Integer

Answer explanation

Juan made a float variable because the value assigned to costOfApples includes a decimal point.