Skip to content

Commit

Permalink
add mapReduce to utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 29, 2018
1 parent 463b553 commit f05b028
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export const error = (message) => {
console.error("[Moon] ERROR: " + message);
}
};

export const mapReduce = (arr, fn) => arr.reduce((result, current) => result + fn(current), "");

0 comments on commit f05b028

Please sign in to comment.