Answer the question
In order to leave comments, you need to log in
Why are we able to create a variable and an object key with the same name?
After all, an object does not create its own scope. Why then is this possible?
Answer the question
In order to leave comments, you need to log in
let x = 1;
const y = {
x: 2
}
x
, and to get the field x
from the object y
, you need to refer to y.x
, which will, in fact, be the full name of the field, and it is different from x
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question