Skip to content

Instantly share code, notes, and snippets.

@koolii
Created February 5, 2016 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koolii/887b19b259c148ccddb1 to your computer and use it in GitHub Desktop.
Save koolii/887b19b259c148ccddb1 to your computer and use it in GitHub Desktop.
'use strict';
let getUniqueArray = (str, delimiter) => {
let uniqueStore = new Set();
str.split(delimiter).forEach(function(id) {
if (id === '' || id === null) {
return;
}
uniqueStore.add(id);
});
return Array.from(uniqueStore.values());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment