Variables Flashcards

1
Q

hold reusable data in a program and associate it with a name.

are stored in memory

A

Variables

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

is the preferred way to declare a variable when it can be reassigned

A

let

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

is the preferred way to declare a variable with a constant value.

A

const

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

The ______ keyword returns the data type (as a string) of a value.

The ______ operator checks the value to its right and returns, or passes back, a string of the data type.

A

typeof

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

is a JavaScript keyword that creates, or declares, a new variable.

A

var

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

we used the += assignment operator to reassign w. We’re performing the mathematical operation of the first operator + using the number to the right, then reassigning w to the computed value.

-=, *=, and /=

A
let w = 4;
w += 1;

console.log(w); // Output: 5

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

The increment operator will increase the value of the variable by 1. The decrement operator will decrease the value of the variable by 1.

A

++

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