Why doesn't break work?

  • 0
    Why doesn't the loop end when writing to the prompt stop, 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;
    }
    }
    JavaScript Conor Arroyo, Sep 28, 2020

  • 2 Answers
  • 0
    You should use something like this:

    Anonymous

  • 0
    And with a fig there will be a stop after parseInt?
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!