Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let score = [10,2,3,3,2];
- let doublon = [];
- for (let i = 0; i < score.length; i++) {
- var temp = score[i];
- for (let j = i+1; j < score.length; j++) {
- if (temp === score[j]) {
- doublon.push(temp)
- }
- }
- }
- console.log(doublon);
Add Comment
Please, Sign In to add comment