variables for strings Flashcards
In the following code, “Mark” is a string. What is name (answer with 1 word)?
var name = “Mark”;
variable
In one word, if it is enclosed in quotation marks, what is it?
string
What is the keyword that declares a variable?
var
This statement…
userName = “buddy5000”;
…is correct only if the variable has already been _______.
declared
In a single statement, declare the variable nickname and assign the string “Satchmo” to it.
var nickname = “Satchmo”;
Declare the variable teamName.
var teamName;
var bestMan = “Charlie”;
bestMan = “Tom”;
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
var city;
city = “Boston”;