Flashcards in Variables Deck (27):
What are Variables Types?
Numbers, Strings, Digits, underscores and dollar signs
Variables Names rule 1
Names must begin with a letter
Variables Names rule 2
Names can also begin with $ and _
Yes. Example: y and Y are different variables
Can reserved words be used
What is an Assignment Operator sign
equal sign (=)
what does the equal sign (=) mean?
"assignment" operator, not an "equal to" operator.
Does the equal sign (=) mean "equal to" operator.
No. it's a assignment operator only
What can a variables hold?
Numbers and text
What is a String?
A text values
Inside double " " or single quotes ' '
Can you place a number within a string?
Yes, but it will be treated as a text string not a number.
What is creating a Variable called?
"declaring" a variable.
var name = 1 and/or name = 1
What is undefined?
The variable has no value
How do you assign a value to a Variable?
use the equal sign
Example: var name = Jon;
what is ==?
containers for storing data values
good programming practice is
to declare all variables at the beginning of a script.
one statement can have
can declare many variables
Example: var person = "John Doe", carName = "Volvo", price = 200;
Variables can span
Example: var person = "John Doe",
carName = "Volvo",
price = 200;
declared without a value
variable declared without a value
No, it will not lose its value.
yes, Example: var x = 5 + 2 + 3;