Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

ES-5 Find Unique Names

Given that you have the following data that is comprised from many names.

let names = [
  'Mauro',
  'Eugen',
  'Mauro',
  'Meir',
  'Eugen',
  'Jens',
  'Jens',
  'Jake',
  'Mohammed',
  'Mauro',
  'Mohammed',
  'Marcelo',
  'Sue',
  'Murhaf',
  'Jens'
];

Create a single arrow function that accepts this array as an argument and returns a new collection (new array with unique names, so no duplicates allowed. All the names but only once!).

Hint: You can use the Set constructor you just learned and pass an array as an argument...

 

 

Return Unique Names

Kostas Diakogiannis
Module by Kostas Diakogiannis, updated more than 1 year ago
No tags specified