Answer the question
In order to leave comments, you need to log in
Why doesn't break work?
Why doesn't the loop end when I write to the stop prompt, and yes, I'm a beginner:(
let arrA = [];
arrA = fillArr('A');
function fillArr(arrName) {
for (i = 0; ; i++) {
arrA[i] = parseInt(prompt('Elements of arrA'));
if (arrA[i] == 'stop') break;
}
}
Answer the question
In order to leave comments, you need to log in
I'm not an expert in pros, but according to the text of the error, you need to initialize the u2 variable before using it. Just add for exampleu2=0;
And why the hell will there be a stop after the parseInt operation?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question