Last active
January 13, 2020 07:08
-
-
Save hagi4u/9b50717d0988f7d52a375251b26daf8f to your computer and use it in GitHub Desktop.
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
/* | |
* [A,B,C,D] 배열이 있을 때 | |
* 'A, B, C and D' 형태로 영어에서 여러가지 문자들을 나열할 때 필요한 | |
* 아웃풋을 내 주는 헬퍼 | |
*/ | |
export function getEnglishListUpString(x) { | |
return x.join(', ').replace(/, ([^, ]*)$/, ' and $1'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment