Skip to content

Commit

Permalink
Code to remove Duplicate elements in array
Browse files Browse the repository at this point in the history
Code to remove the Duplicate Number from an  array without using  In built functions
  • Loading branch information
Arunkumar1712 authored Jan 4, 2024
1 parent 75568e9 commit 92c5e05
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions remove dup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// removing duplicates from arrray
var a =[1,3,5,3,2,7];
var arr=[]
for(var i=0;i<a.length;i++){
var count =0;
for(var j=i+1;j<a.length;j++){
if(a[i] === a[j]){
count ++;
}

}
if(count<=0){
arr.push(a[i]);
}
}
console.log(arr);

0 comments on commit 92c5e05

Please sign in to comment.