I don’t understand question 2, I could not figure out how the answer is: false true false. Can you explain to me how this question is solved?

Type your question above this line.


Hi @Elbekjon_Bakhronbeko

On line 1, we declare a new boolean array of size 3. By default, each element is assigned a value of false, so the array looks like [false, false, false].

On line 2, we assign the first element a value of false, since arr.length == 2 evaluates to false. On line 3, we assign the second element a value of true, since arr.length == 3 evaluates to true. The array now looks like [false, true, false].

Hope this helped!