variables for strings Flashcards

1
Q

In the following code, “Mark” is a string. What is name (answer with 1 word)?

var name = “Mark”;

A

variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In one word, if it is enclosed in quotation marks, what is it?

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the keyword that declares a variable?

A

var

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

This statement…
userName = “buddy5000”;
…is correct only if the variable has already been _______.

A

declared

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In a single statement, declare the variable nickname and assign the string “Satchmo” to it.

A

var nickname = “Satchmo”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Declare the variable teamName.

A

var teamName;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

var bestMan = “Charlie”;

A

bestMan = “Tom”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Declare a variable of your choice without defining it. Then, in a second statement, assign it a string of your choice. (You’ve learned only one rule for naming variables so far, so it’s the only one I’ll hold you to.)
hint city, boston

A

var city;

city = “Boston”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly