03 Values and Variables

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

8 Terms

1
New cards

What is the meaning of primitive values being immutable ?

We can’t change primitive values. For example we have this code:
let a = ‘abc’

a[0] = ‘d’

console.log(a)
What is the output of this code ?

2
New cards

Can we set a property on a primitive value ?

No, we can’t. If you try to do so, it will not work.

3
New cards

“Primitive valuse are read-only.” is this statement true ?

yes, they are immutable. We can’t change them.

4
New cards

Are variables values ?

No, they are not. They point to values.

5
New cards

Is the following statement correct ? “Variables do not point to values.

Incorrect. Variables point to values. They are not values themselves.

6
New cards

What is variable in javascript universe ?

A variable is a wire that points to a value in our js universe.

7
New cards

is 2 an expression in the code: let a = 2; ?

yes, 2 is a literal expression because it literally results in value 2.

8
New cards

explain this code:
console.log(pet) ?

This code is asking javascript to follow the wire named as “pet” and then log the value that the wire is pointing to.