Variables Flashcards Preview

JavaScript > Variables > Flashcards

Flashcards in Variables Deck (27):
1

What are Variables Types?

Numbers, Strings, Digits, underscores and dollar signs

2

Variables Names rule 1

Names must begin with a letter

3

Variables Names rule 2

Names can also begin with $ and _

4

Is JavaScript case sensitive?

Yes. Example: y and Y are different variables

5

Can reserved words be used

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

6

What is an Assignment Operator sign

equal sign (=)

7

what does the equal sign (=) mean?

"assignment" operator, not an "equal to" operator.

8

Does the equal sign (=) mean "equal to" operator.

No. it's a assignment operator only

9

What can a variables hold?

Numbers and text

10

What is a String?

A text values

11

How is a string writing in javaScript?

Inside double " " or single quotes ' '

12

Can you place a number within a string?

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

13

What is creating a Variable called?

"declaring" a variable.

14

How do you write a variable in JavaScript?

var name = 1 and/or name = 1

15

What is undefined?

The variable has no value

16

How do you assign a value to a Variable?

use the equal sign
Example: var name = Jon;

17

what is ==?

The "equal to" operator is written like == in JavaScript.

18

case-sensitive

JavaScript identifiers are case-sensitive.

19

Variables are

containers for storing data values

20

good programming practice is

to declare all variables at the beginning of a script.

21

one statement can have

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

22

Variables can span

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

23

Value

declared without a value

24

variable declared without a value

undefined

25

will re-declare a JavaScript variable lose it Value?

No, it will not lose its value.

26

can you do arithmetic wit javascript variables?

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

27

Numbers in quotes?

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