Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
9
Prime Number
js object to json string
rr
on_off
100034322376708
Leaning Java Script
Iterate the iteratable object from the iterator object
Strange Attractors
My Code1
Please log in to post a comment.