1/7
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
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 ?
Can we set a property on a primitive value ?
No, we can’t. If you try to do so, it will not work.
“Primitive valuse are read-only.” is this statement true ?
yes, they are immutable. We can’t change them.
Are variables values ?
No, they are not. They point to values.
Is the following statement correct ? “Variables do not point to values.“
Incorrect. Variables point to values. They are not values themselves.
What is variable in javascript universe ?
A variable is a wire that points to a value in our js universe.
is 2 an expression in the code: let a = 2; ?
yes, 2 is a literal expression because it literally results in value 2.
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.