99 Flashcards

(5 cards)

1
Q

Primitive Types (Primitives) in JS

A

Number
String
Boolean
Undefined
Null
Symbol
BigInt

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

Reference Types (Objects) in JS

A

Object Literal
Arrays
Functions
Many More…

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

Primitives are stored in …
Objects are stored in …

A

Primitives are stored in the Call Stack.
Objects are stored in the Heap.

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

What happens when you change the value of a primitive variable and reference variable?

A
  • primitive variable: it does not affect any other variables that have the same value
  • reference variable: it will affect any other variables that reference the same object or array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
const me = {
name: 'Jonas',
age: 30
}
const friend = me
friend.age = 27

console.log(friend) // (1)
console.log(me) // (2)
A

(1)

{name: 'Jonas', age: 27}

(2)

{name: 'Jonas', age: 27}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly