title: Retuning a tuple of indices of two items in an array that add together to a target value
body: <p>My task is to write a function that takes an array of numbers and a target number</p>
  <p>I must find two numbers in the array that add together to form the target, and then return the indices of the two numbers as a tuplet, like so (index1, index2).</p>
  <p>I have created a nested for loop to compare each element of the array to each other element, and then ran an if statement to return the indices when the target value has been reached.</p>
  <p>However, something is not working. I am not sure how to return as a tuplet or perhaps my code to get the indices is wrong. Any help or hints would be very appreciated. Thank you</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function twoSum(numbers, target) {
    for (let i = 0; i &lt; numbers.length; i++) {
      for (let j = 0; j &lt; numbers.length; j++) {
        if (numbers[i] + numbers[j] === target) {
          return [numbers.indexOf(i), numbers.indexOf(j)];
        }
      }
    }
  }</code></pre>
  </div>
  </div>
  </p>