모음제거 .includes

임성은·2023년 5월 8일
0

나의 풀이

function solution(my_string) {

    const moum = ['a','e','i','o','u']
    const answer = [...my_string].filter(i => !moum.includes(i))

    return answer.join('');

}

다른 사람 풀이

function solution(my_string) {
    return my_string.replace(/[aeiou]/g, '');
}

replace를 여기서 볼 줄이야..이런 생각을 하는 ㅅ ㅏ람도 있구나 정말 대단하다

profile
개발자의 길에 당차게 들어서다!!

0개의 댓글