|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
567 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | function min(items) {
|
|---|
| 6 | if (!items || items.length === 0) {
|
|---|
| 7 | return undefined;
|
|---|
| 8 | }
|
|---|
| 9 | let minResult = undefined;
|
|---|
| 10 | for (let i = 0; i < items.length; i++) {
|
|---|
| 11 | const current = items[i];
|
|---|
| 12 | if (current == null || Number.isNaN(current) || typeof current === 'symbol') {
|
|---|
| 13 | continue;
|
|---|
| 14 | }
|
|---|
| 15 | if (minResult === undefined || current < minResult) {
|
|---|
| 16 | minResult = current;
|
|---|
| 17 | }
|
|---|
| 18 | }
|
|---|
| 19 | return minResult;
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | exports.min = min;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.