JAVASCRIPT Flashcards

1
Q

What is the purpose of variables?

A

To store data/values for the future

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

How do you declare a variable?

A

Using var with the equal sign followed by a value

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

By using the = operator

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, numbers, $ and _

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

What does it mean to say that variable names are “case sensitive”?

A

The computer cannot read it

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

What is the purpose of a string?

A

For storing text that wouldn’t make sense to javascript

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

What is the purpose of a number?

A

Used to count

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

What is the purpose of a boolean?

A

Based on if its true and false, the computer will do this or that

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

What does the = operator mean in JavaScript?

A

to assign

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

How do you update the value of a variable?

A

variable name with a new value

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

What is the difference between null and undefined?

A

Null is assigned value and undefined has no assigned value but has been declared.
both are declared but undefined has no assigned value.

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 browser console?

A

Describes what you’re logging out, easier to read/understand

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

Give five examples of JavaScript primitives.

A

string, number, null, undefined, boolean

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

What is bigint

A

Bigger number

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

What data type is returned by an arithmetic operation?

A

numbers

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

What is string concatenation?

A

Combining strings

17
Q

What purpose(s) does the + plus operator serve in JavaScript?

A

add two values and assign the result to a variable

18
Q

What data type is returned by comparing two values (, ===, etc)?

A

boolean, true or false

19
Q

What does the += “plus-equals” operator do?

A

adds the value on the right, to the variable on the left, and then assigns that value back into the variable on the left.

20
Q

What are object properties?

A
21
Q

What are objects used for

A
22
Q

Describe object literal notation

A

Opening curly brace to start off object literal

_____

23
Q

How do you remove a property from an object?

A

Delete operator , object. ___

24
Q

What are the two ways to get or update the value of a property?

A