Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 276 Bytes

getInitials.md

File metadata and controls

15 lines (13 loc) · 276 Bytes

초성 추출

function getInitials(string) {
  return string
    .split('')
    .map(char => {
      const index = (char.charCodeAt(0) - 44032) / 28 / 21;
      if (index >= 0) return String.fromCharCode(index + 4352);
      return char;
    })
    .join('');
}