Skip to content

Instantly share code, notes, and snippets.

@rjcorwin
Forked from greatseth/reduce.js
Created November 29, 2012 20:35
Show Gist options
  • Save rjcorwin/4171729 to your computer and use it in GitHub Desktop.
Save rjcorwin/4171729 to your computer and use it in GitHub Desktop.
couchdb reduce function to find min value
function (key, values, rereduce) {
var min = Infinity
for (var i = 0; i < values.length; i++) {
if (typeof values[i] == 'number') {
min = Math.min(values[i], min)
}
}
return min
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment