Skip to main content
InterviewHubPRO
Section Overview
Q368

Question 368 of 536

Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

69%
JavaScript & V8 Internals (536 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

How do you get unique values of an array

senior LevelCode ExampleAsync & PromisesEvent LoopData Structures

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

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