decord/source/4417_arrayReduce.js

38 lines
670 B
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 4417
// Function ID: 4418
2026-07-20 16:05:17 +00:00
// Name: arrayReduce
// Dependencies: []
2026-08-05 07:35:12 +00:00
// Module 4417 (arrayReduce)
2026-07-20 16:05:17 +00:00
export default function arrayReduce(arg0, arg1, arg2, arg3) {
let num = 0;
if (null != arg0) {
num = arg0.length;
}
2026-07-29 08:29:29 +00:00
let tmp = arg3;
if (arg3) {
tmp = num;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let first = arg2;
2026-07-20 16:05:17 +00:00
let num2 = -1;
2026-07-29 08:29:29 +00:00
if (tmp) {
2026-07-20 16:05:17 +00:00
first = arg0[0];
num2 = 0;
}
let sum = num2 + 1;
let tmp4 = first;
let tmp5 = first;
if (sum < num) {
do {
let tmp6 = tmp4;
let tmp7 = sum;
let tmp8 = arg0;
tmp4 = arg1(tmp4, arg0[sum], sum, arg0);
sum = sum + 1;
tmp5 = tmp4;
} while (sum < num);
}
return tmp5;
};