14. Heterogeneous arrays HELP PLEASE


It keep repeats "Make sure you have at least four elements in myArray" when I have four of them! Also, the result screen is reflecting weird...

first, this is my code:

var myArray = [5, false, "Lynn", juice];
var juice = {};
var juice = {
taste: 'Sweet',
color: 'Red'
myArray = [juice];

and the screen shows:


I don't know what is wrong and why the result screen is showing that things!


This line is attempting to access a variable that is not yet defined. It will raise an exception.

That line is not needed.

Move this to above the first line so juice is defined.

Remove this line since it is overwriting your orginal array.


Thank you so much!! Now I know what is wrong XD


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.