$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · hard · #117
What is the output?
const a = [1, 2, 3]; a.length = 1; console.log(a);
[1]
[1, 2, 3]
[]
[1, undefined, undefined]
Assigning a shorter length truncates the array in place.
Play Problem Solving ▸
◂ #116
all Problem Solving — predict the output questions
#118 ▸