본문 바로가기
알고리즘/Codewars

[Codewars] Remove duplicates from list( kyu) / JavaScript

by fluss 2023. 5. 6.

https://www.codewars.com/kata/57a5b0dfcf1fa526bb000118

 

Codewars - Achieve mastery through coding practice and developer mentorship

A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!

www.codewars.com

 

DESCRIPTION:

Define a function that removes duplicates from an array of numbers and returns it as a result.

The order of the sequence has to stay the same.

 

코드

function distinct(a) {
  return [...new Set(a)];
}

댓글