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.
function twoSum(arr, target) {
var x= arr.forEach(e=>{
return arr.forEach(num=>{
if((e+num)===target){
return [e,num];
}
})
})
return x;
}