How to remove duplicates in Javascript array while keeping latest occurrence?
Issue #952
Use ES6 Map
The Map object holds key-value pairs and remembers the original insertion order of the keys. Any value (both objects and primitive values) may be used as either a key or a value.