Variables Flashcards

1
Q

What are Variables Types?

A

Numbers, Strings, Digits, underscores and dollar signs

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

Variables Names rule 1

A

Names must begin with a letter

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

Variables Names rule 2

A

Names can also begin with $ and _

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

Is JavaScript case sensitive?

A

Yes. Example: y and Y are different variables

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

Can reserved words be used

A

No. Example: (like JavaScript keywords) cannot be used as names

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

What is an Assignment Operator sign

A

equal sign (=)

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

what does the equal sign (=) mean?

A

“assignment” operator, not an “equal to” operator.

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

Does the equal sign (=) mean “equal to” operator.

A

No. it’s a assignment operator only

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

What can a variables hold?

A

Numbers and text

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

What is a String?

A

A text values

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

How is a string writing in javaScript?

A

Inside double “ “ or single quotes ‘ ‘

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

Can you place a number within a string?

A

Yes, but it will be treated as a text string not a number.

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

What is creating a Variable called?

A

“declaring” a variable.

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

How do you write a variable in JavaScript?

A

var name = 1 and/or name = 1

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

What is undefined?

A

The variable has no value

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

How do you assign a value to a Variable?

A
use the equal sign
Example: var name = Jon;
17
Q

what is ==?

A

The “equal to” operator is written like == in JavaScript.

18
Q

case-sensitive

A

JavaScript identifiers are case-sensitive.

19
Q

Variables are

A

containers for storing data values

20
Q

good programming practice is

A

to declare all variables at the beginning of a script.

21
Q

one statement can have

A
can declare many variables 
Example: var person = "John Doe", carName = "Volvo", price = 200;
22
Q

Variables can span

A
multiple lines
Example: var person = "John Doe",
carName = "Volvo",
price = 200;
23
Q

Value

A

declared without a value

24
Q

variable declared without a value

A

undefined

25
Q

will re-declare a JavaScript variable lose it Value?

A

No, it will not lose its value.

26
Q

can you do arithmetic wit javascript variables?

A

yes, Example: var x = 5 + 2 + 3;

27
Q

Numbers in quotes?

A

he rest of the numbers will be treated as strings, and concatenated.