Frontend
Interviews
.dev
Problems
644. Array.fill Shared References
Easy
•
...
Predict the output.
const
arr
=
Array
(
2
)
.
fill
(
{
x
:
0
}
)
arr
[
0
]
.
x
=
9
console
.
log
(
arr
[
1
]
.
x
)
What is printed in the console?
0
9
undefined
TypeError
Submit Answer
Reveal Answer
Select an option and submit your answer.
Next Problem
Auto-advance on correct answer