Logo

Programming-Idioms

History of Idiom 119 > diff from v45 to v46

Edit summary for version 46 by programming-idioms:
New JS implementation by user [programming-idioms]

Version 45

2019-01-03, 09:40:04

Version 46

2019-01-03, 09:41:58

Idiom #119 Deduplicate list

Remove duplicates from list x.
Explain if original order is preserved.

Illustration

Idiom #119 Deduplicate list

Remove duplicates from list x.
Explain if original order is preserved.

Illustration
Extra Keywords
deduplicate dupe dupes redundant redundancy undupe
Extra Keywords
deduplicate dupe dupes redundant redundancy undupe
Code
x = Array.from(new Set(x));
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from
Origin
https://twitter.com/addyosmani/status/1080727964411674624?s=09