*
์ผ๋ก ๊ฐ๋ฆฐ ๋ฌธ์์ด์ ๋ฆฌํดํ๋ผfunction solution(phone_number) { return phone_number = '*'.repeat(phone_number.slice(0, -4).length) + phone_number.slice(-4); }
- ๋ฐ๋ก ์ฑ๊ณต์ ํ์ผ๋ ๊ฐ๋ ์ฑ์ด ์ข์ง์์์ ์๋์ฒ๋ผ ์ฌ๊ตฌ์ฑํ๋ค.
function solution(phone_number) { const numStar = '*'.repeat(phone_number.slice(0, -4).length) const lastDigits = phone_number.slice(-4); const answer = numStar + lastDigits return answer; }