Skip to content

Instantly share code, notes, and snippets.

@ArtemRomanovsky
Last active November 6, 2020 11:50
Show Gist options
  • Save ArtemRomanovsky/21a7f83dd70da7f437ccb6f6cdf5530a to your computer and use it in GitHub Desktop.
Save ArtemRomanovsky/21a7f83dd70da7f437ccb6f6cdf5530a to your computer and use it in GitHub Desktop.
const items = {};
return {{result.data}}.map(item => {  
return {
value: item.name,
title: item.name,
};
}).filter(item => {
return items.hasOwnProperty(item.value) ? false : (items[item.value] = true);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment