Skip to content

Instantly share code, notes, and snippets.

@lupomontero
Last active July 6, 2018 13:07
Show Gist options
  • Save lupomontero/82840b0cc0d26bd6b9c37fbdbdebb22f to your computer and use it in GitHub Desktop.
Save lupomontero/82840b0cc0d26bd6b9c37fbdbdebb22f to your computer and use it in GitHub Desktop.
exports.uniq = arr => arr.reduce(
(prev, item) => (prev.indexOf(item) === -1) ? prev.concat(item) : prev,
[],
);
exports.pluck = (arr, prop) => arr.map(obj => obj[prop]);
exports.extractCampus = cohortids =>
cohortids.map(item => item.slice(0, item.indexOf('-')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment