Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const re = [1,2,3,4,5]
- const value = 7
- for(var x in re){
- for(var y in re){
- if(re[x]+re[y] === value && re[x]!== re[y]){
- console.log("found"+x)
- re[x] = NaN
- re[y] = NaN
- }
- }
- }
- console.log(re)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement