Totally confused, Im sure it's simple, Help! 'While" loop and 'for' loop


#1

Instructions:
Write two loops in the editor: one while, one for. No restrictions on this one; just make sure your loops are syntactically correct, and be careful to avoid infinite loops!

this is my code:

while (i=0) {
console.log("While loop."); } {
i++; };
for (var i = 0; i<=1; i+1) {
console.log(i); };

or now....

int i=0;
while (i=0) {
console.log("While loop" + "i");

i++; };
for (var i = 0; i<=1; i++) {
console.log(i); };

`


#2

@angelaitsm,
Read the documentation
the for-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for

the while-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while

the do-while-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/do...while


#3

thank you. I figured it out!