Last active
December 18, 2015 15:08
-
-
Save rike422/5801928 to your computer and use it in GitHub Desktop.
重複検出
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 characters
function dupulicate(array) { | |
var storage = {}; | |
var duplicateArray = []; | |
var i,value; | |
for ( i=0; i < array.length; i++) { | |
value = array[i]; | |
if (value in storage) { | |
duplicateArray.push(value); | |
} else { | |
storage[value] = true; | |
} | |
} | |
return duplicateArray; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment