Skip to content

Instantly share code, notes, and snippets.

@koolii
Last active February 5, 2016 17:06
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/ee1e455af2791f530141 to your computer and use it in GitHub Desktop.
Save koolii/ee1e455af2791f530141 to your computer and use it in GitHub Desktop.
'use strict';
let getUniqueArrayCreator = () => {
let store = new Set();
return ({
add: function(...array) {
if (!array) {
return;
}
array.forEach(function(item) {
if(!item && item === '') {
return;
}
store.add(item.trim());
});
},
create: function() {
return [...store.values()];
}
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment