Created
June 2, 2020 02:32
-
-
Save sonbyungjun/906c7ca314e222b212fbdb46dd067d97 to your computer and use it in GitHub Desktop.
TypeScript(Javascript) duplicateCheck Function (타입스크립트(자바스크립) 중복체크 함수)
This file contains 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
export function duplicateCheck(array: any[]) { | |
return array.reduce((t, a) => { | |
t[a] = (t[a] || 0) + 1; | |
return t | |
}, {}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment