Last active
February 5, 2021 16:57
-
-
Save bendc/da83fdac68a1095f3595 to your computer and use it in GitHub Desktop.
Revisions
-
bendc revised this gist
Dec 9, 2014 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,8 +14,7 @@ function removeDuplicates(arr) { } if (duplicate) continue clean[cleanLen++] = el } return clean -
bendc revised this gist
Dec 9, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ function removeDuplicates(arr) { var duplicate = false for (var j = 0; j < cleanLen; j++) { if (el !== clean[j]) continue duplicate = true break } -
bendc renamed this gist
Dec 9, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bendc created this gist
Dec 9, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ function removeDuplicates(arr) { var clean = [] var cleanLen = 0 var arrLen = arr.length for (var i = 0; i < arrLen; i++) { var el = arr[i] var duplicate = false for (var j = 0; j < cleanLen; j++) { if (el != clean[j]) continue duplicate = true break } if (duplicate) continue clean[cleanLen] = el cleanLen++ } return clean }