source: node_modules/es-toolkit/dist/compat/math/min.mjs@ ba17441

Last change on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 475 bytes
RevLine 
[a762898]1function min(items) {
2 if (!items || items.length === 0) {
3 return undefined;
4 }
5 let minResult = undefined;
6 for (let i = 0; i < items.length; i++) {
7 const current = items[i];
8 if (current == null || Number.isNaN(current) || typeof current === 'symbol') {
9 continue;
10 }
11 if (minResult === undefined || current < minResult) {
12 minResult = current;
13 }
14 }
15 return minResult;
16}
17
18export { min };
Note: See TracBrowser for help on using the repository browser.