Javascript-primitives & variables Flashcards

1
Q

What is the purpose of variables?

A

Store Data

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

how do you declare a variable?

A

var (keyword) _____(variable name);

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

How do you initialize (assign a value to) a variable?

A

assign operations

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

What characters are allowed in variable names?

A

letters, $

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

What is the purpose of a string?

A

any type of text

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

What is the purpose of a number?

A

is a primitive warpper object used to represent & manipulate numbers

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

What is the purpose of a boolean?

A

only gives 2 values, true or false

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

What does the = operator mean in JavaScript?

A

assigned to

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

How do you update the value of a variable?

A

= (equals sign)

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

What is the difference between null & undefined?

A
Null = a represents a reference to a nonexistent or invalid object.
undefined= is a primitive value automatically assigned to a varibales but with no value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Give 5 examples of JavaScript primitives?

A

strings, null, boolean,number, bigint, undefined, symbol

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

Why is it a good habit to include “labels” when you log values to the brower console?

A

so you know what you are console logging

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