Skip to content

Instantly share code, notes, and snippets.

@phaistonian
Created May 8, 2013 13:54
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 phaistonian/5540574 to your computer and use it in GitHub Desktop.
Save phaistonian/5540574 to your computer and use it in GitHub Desktop.
A d3_min variation. Use native Math.min method if applicable for faster results.
d3.min = function(array, f) {
var i = -1, n = array.length, a, b;
if (!f) {
for (var y = 0; parseInt(array[y]); y++) {}
if (y === array.length) return Math.min.apply(Math, array);
}
// Continue existing logic below
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment