title: How to add multiple elements into an Array
body: <p>I'm trying to take an input from a text file (for example 3 7 9 53 2) and place those values into an array.</p>
  
  <p>3 7 9 53 2</p>
  
  <p>I tried with prompt(), but I obviously can only add them one by one:</p>
  
  <pre><code>for (var i = 0; i &lt; n; i++) {
      Array[i] = parseInt(prompt("Value for Array"));
  }
  </code></pre>
  
  <p>However, I want to read line by line and add them to an array. A line will contain hundreds of numbers. is there a way to fill an array quickly by copying and pasting the data into the console? Like in java </p>
  
  <pre><code>String[] line = sc.nextLine().split(" ");
  </code></pre>