let array2 = ['Banana', ['Apples', ['Oranges'], 'Blueberries']];
document.write(array2[0][0]);
In attempting to access the value Apples
within this nested array, I encountered unexpected behavior. Initially, accessing array2[0]
correctly returned Banana
. However, upon trying array2[0][0]
, the output was just B
. The same occurred with array2[0][1]
, resulting in a
. It seems that the string Banana
was somehow interpreted as an array.