Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Remove Duplicates
//Title of this code //V8 3.31.1 function removeDuplicate(arr) { ass_arr = []; for (i=0; i<arr.length; i++) { ass_arr[arr[i]]=0; } for (i=0; i<arr.length; i++) { if (ass_arr[arr[i]]==0) ass_arr[arr[i]]++; else { arr[i]=-1; } } out_arr=[] for (i=0;i<arr.length;i++) { if (arr[i]!=-1) { out_arr.push(arr[i]); } } print(out_arr); } removeDuplicate([1,2,3,3,3,4,5,5]);
run
|
edit
|
history
|
help
0
Add more strength to input color
random2
Just stop thinking about it and go eat
Functions
a pipeline generator
JS exam part 2 - BPM
Try
Looping Strings
WC
zeroMatrix