Read here. Code on desktop. The coding workspace opens on screens 1024px and wider.
JavaScript interview question
Unique Array
easy10 min
Remove duplicate array values while preserving the order in which distinct values first appear.
Requirements
Implement uniqueArray(array), returning a new array containing each distinct value once, in first-encounter order.
Use SameValueZero equality: NaN values are duplicates, 0 and -0 are duplicates, and objects or arrays match only by reference. Keep shared zero as positive 0. Do not coerce different types.
Preserve object and symbol identities. Sparse slots count as undefined and are represented at most once in the output.
Do not mutate the input. Empty input returns a new empty array. Set is allowed.