/
ai_sampletext
/
DiplomWork
Обзор
Документация
Войти
/
ai_sampletext
/
DiplomWork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/d3-array/src/reduce.js
14 строк
460 B
boolyshareyo
Initial commit
08 июн 2026, 16:00
08 июн 2026, 16:00
6216a29
Код
Авторство
О чём код?
export default function reduce(values, reducer, value) { if (typeof reducer !== "function") throw new TypeError("reducer is not a function"); const iterator = values[Symbol.iterator](); let done, next, index = -1; if (arguments.length < 3) { ({done, value} = iterator.next()); if (done) return; ++index; } while (({done, value: next} = iterator.next()), !done) { value = reducer(value, next, ++index, values); } return value; }