Search Header Logo

Printing and Variables in JavaScript

Authored by Daniel Clark

Computers

9th - 12th Grade

Used 7+ times

Printing and Variables in JavaScript
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?