강의

멘토링

커뮤니티

Inflearn Community Q&A

leesee290302's profile image
leesee290302

asked

Introduction to Javascript Algorithm Problem Solving (Coding Test Preparation)

17. Remove duplicate words

Set 이용

Written on

·

185

0

강사님 이렇게 풀어도 되나요??

 function solution(s){  
                let answer;
                answer = Array.from(new Set(str))
                return answer;
            }
            let str=["good", "time", "good", "time", "student"];
            console.log(solution(str));
javascript코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. set 자료구조로 해도 상관없습니다.

leesee290302's profile image
leesee290302

asked

Ask a question