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
Animal categories
More JS
FÜU 23.08
BinaryGap, javascript - Find longest sequence of zeros in binary representation of an integer.
G
merge json array objects based on ID
Loops
test
BF.JS
Add more strength to input color