title: Got undefined as output. What is going wrong with this code?
body: <p>Here arr is array target is any number. I wants to return two numbers of arr. Sum of those number equals to value stored in target.</p>
  <pre><code>function twoSum(arr, target) {
         var x= arr.forEach(e=&gt;{
         return arr.forEach(num=&gt;{
            if((e+num)===target){
              return [e,num];
            }
          })
        })
        return x;
      }
  </code></pre>