title: Cannot read properties of null (reading 'split'). prompt
body: <p>Good afternoon,</p>
  <p>Please, could you help me with an issue below.
  I am getting an error &quot;Cannot read properties of null (reading 'split')&quot; when trying to click &quot;cancel&quot; on prompt.</p>
  <p>What all I want, to loop canceled when I cancel it in prompt.</p>
  <p>ps.: this is a simple array with a name/surname which in future will shows via console.log</p>
  <pre><code>function UserList () {
      let users = [];
      while(true) {
          users.push (prompt('Please, enter your name surname?').split(' '));
          if (prompt=== null) {
              alert('cancel');
          }
      }
  }
  let userList = new UserList();
  </code></pre>