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 CodingAdvertisement
728x90
364of476