source: node_modules/es-toolkit/dist/compat/math/max.js

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

Added visualizations

  • Property mode set to 100644
File size: 567 bytes
RevLine 
[a762898]1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5function max(items) {
6 if (!items || items.length === 0) {
7 return undefined;
8 }
9 let maxResult = 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 (maxResult === undefined || current > maxResult) {
16 maxResult = current;
17 }
18 }
19 return maxResult;
20}
21
22exports.max = max;
Note: See TracBrowser for help on using the repository browser.