While loop, review!, they just don`t work!


// Write your code below!
var myBag= ["cake";"choclate";"sweet"];
for (var i=0; i console.log (myBag[i]);
var j= ["cake";"choclate";"sweet"];
console.log (myBag[j]);
do h= 0;
console.log (myBag[h++]);
while(h };


Can you post a link to the question your on?


@netrockstar26947 please review array syntax. Your console.log also looks strange... And, as @unexpectedtoken says, in the future it would behoove one to post questions with a link to the lesson, as well as properly formatted code, a copy of the error message, and an explanation of what one don't understand.


I wasn't sure what the question was nor did I know what you were trying to do. Your code was a little disorganized.


@unexpectedtoken I apologize for being unclear; I meant I agree with you.


Oh no apology needed, I completely understood what you said. I was just letting netrockstare know some issues with this code.


Phew, thanks for the confirmation :slight_smile: You never know on the internet. Indeed, without sharing those pieces of info it will be very difficult to help (*coughs*).