title: How do i generate and sum up random numbers from an array in javascript and python
body: <p>I have a function that takes an array and a target number. The goal is two generate any two random numbers from the array and sum them up. If the sum of the two random integers is equal to the target number, I then have to return the index of the two random numbers in the array.</p>
  <p>Here is my code so far, I keep getting a stderr. How do you recommend I go about this.</p>
  <pre><code>function twoSum (numbers, target) {
    let numIdx = [];
    let sum = 0;
    let firstValue = 0;
    let secValue = 0
  
    while(sum !== target) {
      firstValue = Math.floor(Math.random() * numbers.length);
      secValue = Math.floor(Math.random() * numbers.length);
      sum = firstValue + secValue;
      
      if (sum === target) {
        numIdx.push(numbers[firstValue])
        numIdx.push(numbers[secValue])
        return numIdx
      }
    }
  }
  </code></pre>