Skip to content

Instantly share code, notes, and snippets.

@hoyangtsai
Created June 21, 2023 01:05
Show Gist options
  • Save hoyangtsai/ac5907135f80db9168cec5d7eca2b369 to your computer and use it in GitHub Desktop.
Save hoyangtsai/ac5907135f80db9168cec5d7eca2b369 to your computer and use it in GitHub Desktop.
#BigInt #math min function
function min(...values) {
if (values.length < 1) {
return Infinity;
}
let minValue = values.shift();
for (const value of values) {
if (value < minValue) {
minValue = value;
}
}
return minValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment