728x90
function eulruel(str) {
const start = 44032; // 가
const end = 55203; // 힣
const lastCode = str.charCodeAt(str.length - 1);
let toggle = false;
if ( lastCode < start || lastCode > end ) return false;
if ( (lastCode - start) % 28 == 0 ) toggle = true;
return toggle ? `${str}를` : `${str}을`
}
728x90