Search Header Logo

KA Intro to JS Variables

Computers

KG - University

Used 549+ times

KA Intro to JS Variables
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

30 sec • 1 pt

Which of these lines of code is valid JavaScript for defining a variable?

var noseSize = 10;
noseSize is 10
var noseSize == 10;
var nose Size = 10;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is a valid variable name in JavaScript?

123abc
abc123
abc   123
abc123!

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these lines show the correct way to reassign a variable to a new value?

myFace = 10;
10 -> myFace;
var myFace = 10;
10 = myFace;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If boxSize is a variable holding the value 20, which of these lines of code would make a 20x20 square?

rect(10, 10, boxSize, boxSize);
rect(boxSize, 10, 10, boxSize);
rect(10, 10, boxSize);
rect(10, 10, boxSize * boxSize);

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If cPos is a variable holding the value 200, which of these would draw a circle with a center point of 150, 

ellipse(cPos-50, cPos-50, 20, 20);
ellipse(cPos+50, cPos+50, 20, 20);
ellipse(cPos-50, 20, 20);
ellipse(cPos-=50, cPos-=50, 20);

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?