JS Coding Questions Logo
JS Coding Questions
#364💼 Interview💻 Code

How do you get unique values of an array

Advertisement

728x90

You can get unique values of an array with the combination of Set and rest expression/spread(...) syntax.

javascript
1console.log([...new Set([1, 2, 4, 4, 3])]); // [1, 2, 4, 3]

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 21

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
364of476