Return not in function


Syntax error: return not in function
I do not exactely know why this error occours. Can anyone pls. help?

for(i = 0 ; i > 3 ; i++)
        console.log("'For' schleife");

var j = true;
while (j)
        console.log("'While' Schleife");
        return (j = false);


Looking at the error shown in your console, the issue should be here.

You could simply leave it as:

j = false;


Now i see. I do not have to return something...
Because it is a loop... TX...



You're welcome. Have fun coding! :slight_smile:


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