source: node_modules/victory-vendor/lib-vendor/d3-array/src/maxIndex.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: 650 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = maxIndex;
7function maxIndex(values, valueof) {
8 let max;
9 let maxIndex = -1;
10 let index = -1;
11 if (valueof === undefined) {
12 for (const value of values) {
13 ++index;
14 if (value != null && (max < value || max === undefined && value >= value)) {
15 max = value, maxIndex = index;
16 }
17 }
18 } else {
19 for (let value of values) {
20 if ((value = valueof(value, ++index, values)) != null && (max < value || max === undefined && value >= value)) {
21 max = value, maxIndex = index;
22 }
23 }
24 }
25 return maxIndex;
26}
Note: See TracBrowser for help on using the repository browser.